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>
This commit is contained in:
Denys Vlasenko
2017-04-06 15:22:24 +02:00
parent 0d6e3ad663
commit 4f0b540d08
2 changed files with 38 additions and 17 deletions

View File

@@ -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.