diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-06-03 19:08:49 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-06-03 19:08:49 +0000 |
commit | 2c351a8f9875a4b597641bc4c0da76db485fe184 (patch) | |
tree | 36045a7b18dceb31cda53d7579f38c68fd743394 | |
parent | 62558765b91a535126a74c8464fa835900b11693 (diff) | |
download | busybox-w32-2c351a8f9875a4b597641bc4c0da76db485fe184.tar.gz busybox-w32-2c351a8f9875a4b597641bc4c0da76db485fe184.tar.bz2 busybox-w32-2c351a8f9875a4b597641bc4c0da76db485fe184.zip |
- patch from Yann E. Morin: makes modprobe understand shell patterns
(especially '*') in module aliases, such as:
"alias usb:v0582p0075d*dc*dsc*dp*ic*isc*ip* snd_usb_audio"
Fixes bug #889
842162 10244 645924 1498330 16dcda busybox.old-4.1.20060603-1948
842178 10244 645924 1498346 16dcea busybox.new-4.1.20060603-1948
-rw-r--r-- | modutils/modprobe.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 59c06ee1e..44460391a 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <string.h> | 21 | #include <string.h> |
22 | #include <ctype.h> | 22 | #include <ctype.h> |
23 | #include <fcntl.h> | 23 | #include <fcntl.h> |
24 | #include <fnmatch.h> | ||
24 | #include "busybox.h" | 25 | #include "busybox.h" |
25 | 26 | ||
26 | struct mod_opt_t { /* one-way list of options to pass to a module */ | 27 | struct mod_opt_t { /* one-way list of options to pass to a module */ |
@@ -721,9 +722,13 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t * | |||
721 | struct mod_opt_t *opt = 0; | 722 | struct mod_opt_t *opt = 0; |
722 | char *path = 0; | 723 | char *path = 0; |
723 | 724 | ||
724 | // check dependencies | 725 | /* Search for the given module name amongst all dependency rules. |
726 | * The module name in a dependency rule can be a shell pattern, | ||
727 | * so try to match the given module name against such a pattern. | ||
728 | * Of course if the name in the dependency rule is a plain string, | ||
729 | * then we consider it a pattern, and matching will still work. */ | ||
725 | for ( dt = depend; dt; dt = dt-> m_next ) { | 730 | for ( dt = depend; dt; dt = dt-> m_next ) { |
726 | if ( strcmp ( dt-> m_name, mod ) == 0) { | 731 | if ( fnmatch ( dt-> m_name, mod, 0 ) == 0) { |
727 | break; | 732 | break; |
728 | } | 733 | } |
729 | } | 734 | } |