Author: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> 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. It should just fail instead. Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Index: module-init-tools-3.3-pre11/depmod.c =================================================================== --- module-init-tools-3.3-pre11.orig/depmod.c +++ module-init-tools-3.3-pre11/depmod.c @@ -1174,10 +1174,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);