[BusyBox-cvs] busybox/modutils modprobe.c,1.22,1.23

Erik Andersen andersen at busybox.net
Fri Nov 14 02:49:23 UTC 2003


Update of /var/cvs/busybox/modutils
In directory winder:/tmp/cvs-serv31835/modutils

Modified Files:
	modprobe.c 
Log Message:
Steven Seeger writes:

Hey guys. I've found a bug in modprobe where it generates bad strings and
makes sytem calls with them. The following patch seems to have fixed the
problem. It is rather inherited elsewhere, as there seems to be incorrect
entries in the list which results in more dependencies than really exist for
a given call to mod_process. But, this patch prevents the bad text from
going to the screen. You will notice there are cases where lcmd goes
unmodified before calling system.

Please consider the following patch.

Thanks.

-Steve



Index: modprobe.c
===================================================================
RCS file: /var/cvs/busybox/modutils/modprobe.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- modprobe.c	8 Sep 2003 00:32:49 -0000	1.22
+++ modprobe.c	14 Nov 2003 02:49:19 -0000	1.23
@@ -352,6 +352,7 @@
 	int rc = 1;
 
 	while ( list ) {
+		*lcmd = '\0';
 		if ( do_insert ) {
 			if (already_loaded (list->m_module) != 1)
 				snprintf ( lcmd, sizeof( lcmd ) - 1, "insmod %s %s %s %s %s", do_syslog ? "-s" : "", autoclean ? "-k" : "", quiet ? "-q" : "", list-> m_module, list-> m_options ? list-> m_options : "" );
@@ -362,7 +363,7 @@
 		
 		if ( verbose )
 			printf ( "%s\n", lcmd );
-		if ( !show_only ) {
+		if ( !show_only && *lcmd) {
 			int rc2 = system ( lcmd );
 			if (do_insert) rc = rc2; /* only last module matters */
 			else if (!rc2) rc = 0; /* success if remove any mod */




More information about the busybox-cvs mailing list