commit fcafe19e5abf8dd7f002aff2c22347aeae86b617 Author: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Date: Mon Jan 12 18:41:35 2009 -0200 depmod: Fix modules.dep truncation If a wrong module name (or a nonexistent module) is passed to depmod it will truncate the modules.dep file and segfault. The problem is that even if the modules list is empty, depmod will try to do its job. This is wrong, it should do nothing if no modules have been found. Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Index: module-init-tools-3.5/depmod.c =================================================================== --- module-init-tools-3.5.orig/depmod.c +++ module-init-tools-3.5/depmod.c @@ -1311,10 +1311,12 @@ int main(int argc, char *argv[]) /* Do command line args. */ for (opt = optind; opt < argc; opt++) { struct module *new = grab_module(NULL, argv[opt]); - if (new) { - new->next = list; - list = new; + if (!new) { + /* cmd-line specified modules must exist */ + fatal("grab_module() failed for module %s\n", argv[opt]); } + new->next = list; + list = new; } } else { list = grab_basedir(dirname,search,overrides);