From 428bd2d4337dbd83feb3c7d1fc04d840f548003c Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Tue, 31 Jan 2012 14:55:15 +0100 Subject: modprobe: accept -b even if blacklist functionality is disabled Signed-off-by: Felipe Contreras Signed-off-by: Denys Vlasenko --- modutils/modprobe-small.c | 2 +- modutils/modprobe.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'modutils') diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c index f5b283b..5ea1be9 100644 --- a/modutils/modprobe-small.c +++ b/modutils/modprobe-small.c @@ -805,7 +805,7 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) opt_complementary = "-1"; /* only -q (quiet) and -r (rmmod), * the rest are accepted and ignored (compat) */ - getopt32(argv, "qrfsvw"); + getopt32(argv, "qrfsvwb"); argv += optind; /* are we rmmod? -> simulate modprobe -r */ diff --git a/modutils/modprobe.c b/modutils/modprobe.c index c1a1828..fb6c659 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -101,12 +101,15 @@ //usage: ) //usage:#endif /* !ENABLE_MODPROBE_SMALL */ -/* Note that usage text doesn't document various 2.4 options - * we pull in through INSMOD_OPTS define */ -#define MODPROBE_OPTS "alrD" IF_FEATURE_MODPROBE_BLACKLIST("b") +/* Note: usage text doesn't document various 2.4 options + * we pull in through INSMOD_OPTS define + * Note2: -b is always accepted, but if !FEATURE_MODPROBE_BLACKLIST, + * it is a no-op. + */ +#define MODPROBE_OPTS "alrDb" /* -a and -D _are_ in fact compatible */ #define MODPROBE_COMPLEMENTARY ("q-v:v-q:l--arD:r--alD:a--lr:D--rl") -//#define MODPROBE_OPTS "acd:lnrt:C:" IF_FEATURE_MODPROBE_BLACKLIST("b") +//#define MODPROBE_OPTS "acd:lnrt:C:b" //#define MODPROBE_COMPLEMENTARY "q-v:v-q:l--acr:a--lr:r--al" enum { OPT_INSERT_ALL = (INSMOD_OPT_UNUSED << 0), /* a */ @@ -133,10 +136,8 @@ static const char modprobe_longopts[] ALIGN1 = /* module-init-tools 3.11.1 has only long opt --show-depends * but no short -D, we provide long opt for scripts which * were written for 3.11.1: */ - "show-depends\0" No_argument "D" - // IF_FEATURE_MODPROBE_BLACKLIST( + "show-depends\0" No_argument "D" // "use-blacklist\0" No_argument "b" - // ) ; #endif -- cgit v1.1