Sophie

Sophie

distrib > Mandriva > 2008.0 > x86_64 > by-pkgid > 668acc1a9ceeb0f59816691ac07d5eb4 > files > 12

module-init-tools-3.3-pre11.32.1mdv2008.0.src.rpm

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);