summaryrefslogtreecommitdiff
path: root/libmodprobe/libmodprobe_ext_test.cpp
diff options
context:
space:
mode:
authorSteve Muckle <smuckle@google.com>2019-07-31 14:34:52 -0700
committerSteve Muckle <smuckle@google.com>2019-08-06 13:58:13 -0700
commite31f840a0a081cca2ab2a418c9611a01e3b54a98 (patch)
treed543e06c1376079e5fa79476592442302aeacb22 /libmodprobe/libmodprobe_ext_test.cpp
parent13700a69d382d7b4482f63317b6eaf2e3214e012 (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_test.cpp')
-rw-r--r--libmodprobe/libmodprobe_ext_test.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libmodprobe/libmodprobe_ext_test.cpp b/libmodprobe/libmodprobe_ext_test.cpp
index 204809fa5..7d817b1f2 100644
--- a/libmodprobe/libmodprobe_ext_test.cpp
+++ b/libmodprobe/libmodprobe_ext_test.cpp
@@ -67,6 +67,9 @@ bool Modprobe::Rmmod(const std::string& module_name) {
bool Modprobe::ModuleExists(const std::string& module_name) {
auto deps = GetDependencies(module_name);
+ if (blacklist_enabled && module_blacklist_.count(module_name)) {
+ return false;
+ }
if (deps.empty()) {
// missing deps can happen in the case of an alias
return false;