diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-22 17:37:38 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-22 17:37:38 +0000 |
commit | ae84b11467c56316a43de6146100ce22f24cf622 (patch) | |
tree | 283fd8ebb6804e1f1caefb2431ce001690d45b87 | |
parent | dfd8282464c56eda0dba62ad3b9a2a4b71ba725f (diff) | |
download | busybox-w32-ae84b11467c56316a43de6146100ce22f24cf622.tar.gz busybox-w32-ae84b11467c56316a43de6146100ce22f24cf622.tar.bz2 busybox-w32-ae84b11467c56316a43de6146100ce22f24cf622.zip |
modprobe: fix for blacklisting
The patch makes the order of the alias/blacklist in modprobe.conf
irrelevant (like module-utils' modprobe). In first patch the alias had
to be defined before the blacklist which caused problems because the
modprobe.conf file is read before /lib/modules/*/modules.alias.
The attatched patch will mark the blacklisted module itself rather than
trying to find the alias that points to the blacklisted module and test
this flag later in the alias resolving stage.
-rw-r--r-- | modutils/modprobe.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 60dc92665..b7903469d 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
@@ -332,7 +332,7 @@ static void include_conf(struct dep_t **first, struct dep_t **current, char *buf | |||
332 | 332 | ||
333 | mod = skip_whitespace(buffer + 10); | 333 | mod = skip_whitespace(buffer + 10); |
334 | for (dt = *first; dt; dt = dt->m_next) { | 334 | for (dt = *first; dt; dt = dt->m_next) { |
335 | if (dt->m_isalias && strcmp(dt->m_deparr[0], mod) == 0) | 335 | if (strcmp(dt->m_name, mod) == 0) |
336 | break; | 336 | break; |
337 | } | 337 | } |
338 | if (dt) | 338 | if (dt) |
@@ -748,12 +748,13 @@ static void check_dep(char *mod, struct mod_list_t **head, struct mod_list_t **t | |||
748 | 748 | ||
749 | // resolve alias names | 749 | // resolve alias names |
750 | while (dt->m_isalias) { | 750 | while (dt->m_isalias) { |
751 | if (dt->m_depcnt == 1 && !(ENABLE_FEATURE_MODPROBE_BLACKLIST && | 751 | if (dt->m_depcnt == 1) { |
752 | dt->m_isblacklisted)) { | ||
753 | struct dep_t *adt; | 752 | struct dep_t *adt; |
754 | 753 | ||
755 | for (adt = depend; adt; adt = adt->m_next) { | 754 | for (adt = depend; adt; adt = adt->m_next) { |
756 | if (check_pattern(adt->m_name, dt->m_deparr[0]) == 0) | 755 | if (check_pattern(adt->m_name, dt->m_deparr[0]) == 0 && |
756 | !(ENABLE_FEATURE_MODPROBE_BLACKLIST && | ||
757 | adt->m_isblacklisted)) | ||
757 | break; | 758 | break; |
758 | } | 759 | } |
759 | if (adt) { | 760 | if (adt) { |