svn commit: trunk/busybox/modutils

vda at busybox.net vda at busybox.net
Sun Jul 6 11:52:24 UTC 2008


Author: vda
Date: 2008-07-06 04:52:23 -0700 (Sun, 06 Jul 2008)
New Revision: 22666

Log:
modprobe-small: match aliases with fnmatch(), making
 shell pattern-specified alias names in module bodies work.



Modified:
   trunk/busybox/modutils/modprobe-small.c


Changeset:
Modified: trunk/busybox/modutils/modprobe-small.c
===================================================================
--- trunk/busybox/modutils/modprobe-small.c	2008-07-06 11:11:35 UTC (rev 22665)
+++ trunk/busybox/modutils/modprobe-small.c	2008-07-06 11:52:23 UTC (rev 22666)
@@ -385,7 +385,11 @@
 		/* Does matching substring exist? */
 		replace(desc, ' ', '\0');
 		for (s = desc; *s; s += strlen(s) + 1) {
-			if (strcmp(s, alias) == 0) {
+			/* aliases in module bodies can be defined with
+			 * shell patterns. Example:
+			 * "pci:v000010DEd000000D9sv*sd*bc*sc*i*".
+			 * Plain strcmp() won't catch that */
+			if (fnmatch(s, alias, 0) == 0) {
 				free(desc);
 				dbg1_error_msg("found alias '%s' in module '%s'",
 						alias, modinfo[i].pathname);




More information about the busybox-cvs mailing list