aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-02-08 18:34:03 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-02-08 18:34:03 +0100
commit92e531458a6c0e6464fbdc1463f91edc7fb752c7 (patch)
tree72062fc0e07619658d45b88172f230fc0ab34422 /modutils
parent12d97b66805f87e535962963e858fc2422ffdbc7 (diff)
downloadbusybox-w32-1_18_3.tar.gz
busybox-w32-1_18_3.tar.bz2
busybox-w32-1_18_3.zip
Apply post-1.18.2 fixes, bump version to 1.18.31_18_3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils')
-rw-r--r--modutils/modprobe-small.c3
-rw-r--r--modutils/modutils.c11
2 files changed, 8 insertions, 6 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index f4f17e766..188a7f229 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -205,6 +205,7 @@ static void parse_module(module_info *info, const char *pathname)
205 /* Read (possibly compressed) module */ 205 /* Read (possibly compressed) module */
206 len = 64 * 1024 * 1024; /* 64 Mb at most */ 206 len = 64 * 1024 * 1024; /* 64 Mb at most */
207 module_image = xmalloc_open_zipped_read_close(pathname, &len); 207 module_image = xmalloc_open_zipped_read_close(pathname, &len);
208 /* module_image == NULL is ok here, find_keyword handles it */
208//TODO: optimize redundant module body reads 209//TODO: optimize redundant module body reads
209 210
210 /* "alias1 symbol:sym1 alias2 symbol:sym2" */ 211 /* "alias1 symbol:sym1 alias2 symbol:sym2" */
@@ -845,6 +846,8 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
845 846
846 len = MAXINT(ssize_t); 847 len = MAXINT(ssize_t);
847 map = xmalloc_open_zipped_read_close(*argv, &len); 848 map = xmalloc_open_zipped_read_close(*argv, &len);
849 if (!map)
850 bb_perror_msg_and_die("can't read '%s'", *argv);
848 if (init_module(map, len, 851 if (init_module(map, len,
849 IF_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE(options ? options : "") 852 IF_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE(options ? options : "")
850 IF_NOT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE("") 853 IF_NOT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE("")
diff --git a/modutils/modutils.c b/modutils/modutils.c
index 565d0d22f..415dbbe44 100644
--- a/modutils/modutils.c
+++ b/modutils/modutils.c
@@ -71,12 +71,11 @@ char* FAST_FUNC parse_cmdline_module_options(char **argv)
71 optlen = 0; 71 optlen = 0;
72 while (*++argv) { 72 while (*++argv) {
73 options = xrealloc(options, optlen + 2 + strlen(*argv) + 2); 73 options = xrealloc(options, optlen + 2 + strlen(*argv) + 2);
74 /* Older versions were enclosing space-containing *argv in "", 74 /* Spaces handled by "" pairs, but no way of escaping quotes */
75 * but both modprobe and insmod from module-init-tools 3.11.1 75//TODO: module-init-tools version 3.11.1 quotes only value:
76 * don't do this anymore. (As to extra trailing space, 76//it generates var="val with spaces", not "var=val with spaces"
77 * insmod adds it but modprobe does not. We do in both cases) 77//(and it won't quote var *name* even if it has spaces)
78 */ 78 optlen += sprintf(options + optlen, (strchr(*argv, ' ') ? "\"%s\" " : "%s "), *argv);
79 optlen += sprintf(options + optlen, "%s ", *argv);
80 } 79 }
81 return options; 80 return options;
82} 81}