diff options
author | Steve Muckle <smuckle@google.com> | 2019-07-31 14:34:52 -0700 |
---|---|---|
committer | Steve Muckle <smuckle@google.com> | 2019-08-06 13:58:13 -0700 |
commit | e31f840a0a081cca2ab2a418c9611a01e3b54a98 (patch) | |
tree | d543e06c1376079e5fa79476592442302aeacb22 /libmodprobe/libmodprobe_ext.cpp | |
parent | 13700a69d382d7b4482f63317b6eaf2e3214e012 (diff) |
libmodprobe: add support for a blacklist
If the blacklist is enabled, blacklisted modules are treated as though
they are not present.
Change-Id: Ie8712f24298e78f92d5028b1ca3a8a3e07a9190a
Diffstat (limited to 'libmodprobe/libmodprobe_ext.cpp')
-rw-r--r-- | libmodprobe/libmodprobe_ext.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libmodprobe/libmodprobe_ext.cpp b/libmodprobe/libmodprobe_ext.cpp index 52e308fab..3e9ff70cb 100644 --- a/libmodprobe/libmodprobe_ext.cpp +++ b/libmodprobe/libmodprobe_ext.cpp @@ -65,6 +65,9 @@ bool Modprobe::Rmmod(const std::string& module_name) { bool Modprobe::ModuleExists(const std::string& module_name) { struct stat fileStat; + if (blacklist_enabled && module_blacklist_.count(module_name)) { + return false; + } auto deps = GetDependencies(module_name); if (deps.empty()) { // missing deps can happen in the case of an alias |