summaryrefslogtreecommitdiff
path: root/modutils/modprobe-small.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-07-06 11:52:23 +0000
committerDenis Vlasenko2008-07-06 11:52:23 +0000
commit58f59a25ee82dea19aeee082f52846244929a95e (patch)
tree25dfe73eddd983260136dea4b046f3b8f13ba725 /modutils/modprobe-small.c
parentcee0dfcc6a157f54cb517fdc3c438c7e0f67ebc9 (diff)
downloadbusybox-58f59a25ee82dea19aeee082f52846244929a95e.zip
busybox-58f59a25ee82dea19aeee082f52846244929a95e.tar.gz
modprobe-small: match aliases with fnmatch(), making
shell pattern-specified alias names in module bodies work.
Diffstat (limited to 'modutils/modprobe-small.c')
-rw-r--r--modutils/modprobe-small.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 3aa06d5..e82ee4c 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -385,7 +385,11 @@ static module_info* find_alias(const char *alias)
/* 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);