diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-04-06 15:22:24 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-04-06 15:23:26 +0200 |
commit | 4f0b540d08f5912b273c427218cc665512b12de5 (patch) | |
tree | 061a0c4a01fccfe31c88e01e5d50616f5e6b96cb /modutils | |
parent | 0d6e3ad663adc327597f07fdcabd6ac545864d41 (diff) |
modprobe: do not descend into /etc/modprobe.d/DIR/. Closes 8686
Also expanded comments in recursive_action.c
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils')
-rw-r--r-- | modutils/modprobe.c | 9 |
1 files changed, 9 insertions, 0 deletions
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. |