From 4f0b540d08f5912b273c427218cc665512b12de5 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 6 Apr 2017 15:22:24 +0200 Subject: modprobe: do not descend into /etc/modprobe.d/DIR/. Closes 8686 Also expanded comments in recursive_action.c Signed-off-by: Denys Vlasenko --- modutils/modprobe.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modutils') diff --git a/modutils/modprobe.c b/modutils/modprobe.c index c82eaa8d8..51ede9204 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -252,6 +252,15 @@ static int FAST_FUNC config_file_action(const char *filename, if (base[0] == '.') goto error; + /* "man modprobe.d" from kmod version 22 suggests + * that we shouldn't recurse into /etc/modprobe.d/dir/ + * _subdirectories_: + */ + if (depth > 1) + return SKIP; /* stop recursing */ +//TODO: instead, can use dirAction in recursive_action() to SKIP dirs +//on depth == 1 level. But that's more code... + /* In dir recursion, skip files that do not end with a ".conf" * depth==0: read_config("modules.{symbols,alias}") must work, * "include FILE_NOT_ENDING_IN_CONF" must work too. -- cgit v1.2.3