aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
Diffstat (limited to 'modutils')
-rw-r--r--modutils/insmod.c2
-rw-r--r--modutils/modinfo.c2
-rw-r--r--modutils/modprobe-small.c8
-rw-r--r--modutils/modprobe.c19
-rw-r--r--modutils/modutils.c2
5 files changed, 26 insertions, 7 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c
index bd79a0f26..8f7163e25 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -26,7 +26,7 @@
26 26
27//usage:#if !ENABLE_MODPROBE_SMALL 27//usage:#if !ENABLE_MODPROBE_SMALL
28//usage:#define insmod_trivial_usage 28//usage:#define insmod_trivial_usage
29//usage: IF_FEATURE_2_4_MODULES("[OPTIONS] MODULE") 29//usage: IF_FEATURE_2_4_MODULES("[-fkvqLx] MODULE")
30//usage: IF_NOT_FEATURE_2_4_MODULES("FILE") 30//usage: IF_NOT_FEATURE_2_4_MODULES("FILE")
31//usage: IF_FEATURE_CMDLINE_MODULE_OPTIONS(" [SYMBOL=VALUE]...") 31//usage: IF_FEATURE_CMDLINE_MODULE_OPTIONS(" [SYMBOL=VALUE]...")
32//usage:#define insmod_full_usage "\n\n" 32//usage:#define insmod_full_usage "\n\n"
diff --git a/modutils/modinfo.c b/modutils/modinfo.c
index c5cdc7980..d15772f0d 100644
--- a/modutils/modinfo.c
+++ b/modutils/modinfo.c
@@ -20,7 +20,7 @@
20#include "libbb.h" 20#include "libbb.h"
21#include "modutils.h" 21#include "modutils.h"
22 22
23static const char *const shortcuts[] = { 23static const char *const shortcuts[] ALIGN_PTR = {
24 "filename", // -n 24 "filename", // -n
25 "author", // -a 25 "author", // -a
26 "description", // -d 26 "description", // -d
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 18cfac481..db44a2ed0 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -377,11 +377,11 @@ static int parse_module(module_info *info, const char *pathname)
377 return info->open_read_failed; 377 return info->open_read_failed;
378} 378}
379 379
380static FAST_FUNC int fileAction(const char *pathname, 380static FAST_FUNC int fileAction(struct recursive_state *state,
381 struct stat *sb UNUSED_PARAM, 381 const char *pathname,
382 void *modname_to_match, 382 struct stat *sb UNUSED_PARAM)
383 int depth UNUSED_PARAM)
384{ 383{
384 const char *modname_to_match = state->userData;
385 int cur; 385 int cur;
386 const char *fname; 386 const char *fname;
387 bool is_remove = (ENABLE_RMMOD && ONLY_APPLET) 387 bool is_remove = (ENABLE_RMMOD && ONLY_APPLET)
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index eeeff7609..c334186b8 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -663,6 +663,25 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
663 load_modules_dep(); 663 load_modules_dep();
664 } 664 }
665 665
666 /* Handle modprobe.blacklist=module1,module2,... */
667 if (ENABLE_FEATURE_MODPROBE_BLACKLIST) {
668 char *options;
669 char *substr;
670
671 options = parse_and_add_kcmdline_module_options(NULL, "modprobe");
672 while ((substr = strsep(&options, " ")) != NULL) {
673 char *fn = is_prefixed_with(substr, "blacklist=");
674 if (!fn)
675 continue;
676 while ((substr = strsep(&fn, ",")) != NULL) {
677 /* blacklist <modulename> */
678 get_or_add_modentry(substr)->flags |= MODULE_FLAG_BLACKLISTED;
679 DBG("blacklist: %s", substr);
680 }
681 }
682 /*free(options); - WRONG, strsep may have advanced it */
683 }
684
666 rc = 0; 685 rc = 0;
667 while ((me = llist_pop(&G.probes)) != NULL) { 686 while ((me = llist_pop(&G.probes)) != NULL) {
668 if (me->realnames == NULL) { 687 if (me->realnames == NULL) {
diff --git a/modutils/modutils.c b/modutils/modutils.c
index 6f7cd9721..f7ad5e805 100644
--- a/modutils/modutils.c
+++ b/modutils/modutils.c
@@ -169,7 +169,7 @@ void* FAST_FUNC try_to_mmap_module(const char *filename, size_t *image_size_p)
169 /* st.st_size is off_t, we can't just pass it to mmap */ 169 /* st.st_size is off_t, we can't just pass it to mmap */
170 if (st.st_size <= *image_size_p) { 170 if (st.st_size <= *image_size_p) {
171 size_t image_size = st.st_size; 171 size_t image_size = st.st_size;
172 image = mmap(NULL, image_size, PROT_READ, MAP_PRIVATE, fd, 0); 172 image = mmap_read(fd, image_size);
173 if (image == MAP_FAILED) { 173 if (image == MAP_FAILED) {
174 image = NULL; 174 image = NULL;
175 } else if (*(uint32_t*)image != SWAP_BE32(0x7f454C46)) { 175 } else if (*(uint32_t*)image != SWAP_BE32(0x7f454C46)) {