diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | archival/tar.c | 6 | ||||
-rw-r--r-- | coreutils/wc.c | 16 | ||||
-rw-r--r-- | libbb/vfork_daemon_rexec.c | 1 | ||||
-rw-r--r-- | loginutils/Config.src | 4 | ||||
-rw-r--r-- | miscutils/Config.src | 1 | ||||
-rw-r--r-- | modutils/modprobe-small.c | 3 | ||||
-rw-r--r-- | modutils/modutils.c | 11 | ||||
-rw-r--r-- | networking/ping.c | 2 | ||||
-rw-r--r-- | networking/udhcp/common.c | 2 | ||||
-rw-r--r-- | shell/hush.c | 21 | ||||
-rw-r--r-- | util-linux/Config.src | 2 |
12 files changed, 40 insertions, 31 deletions
@@ -1,6 +1,6 @@ | |||
1 | VERSION = 1 | 1 | VERSION = 1 |
2 | PATCHLEVEL = 18 | 2 | PATCHLEVEL = 18 |
3 | SUBLEVEL = 2 | 3 | SUBLEVEL = 3 |
4 | EXTRAVERSION = | 4 | EXTRAVERSION = |
5 | NAME = Unnamed | 5 | NAME = Unnamed |
6 | 6 | ||
diff --git a/archival/tar.c b/archival/tar.c index 82caec770..c0b92615d 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -1037,8 +1037,10 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
1037 | tar_handle->src_fd = tar_fd; | 1037 | tar_handle->src_fd = tar_fd; |
1038 | tar_handle->seek = seek_by_read; | 1038 | tar_handle->seek = seek_by_read; |
1039 | } else { | 1039 | } else { |
1040 | if (ENABLE_FEATURE_TAR_AUTODETECT && flags == O_RDONLY) { | 1040 | if (ENABLE_FEATURE_TAR_AUTODETECT |
1041 | get_header_ptr = get_header_tar; | 1041 | && flags == O_RDONLY |
1042 | && get_header_ptr == get_header_tar | ||
1043 | ) { | ||
1042 | tar_handle->src_fd = open_zipped(tar_filename); | 1044 | tar_handle->src_fd = open_zipped(tar_filename); |
1043 | if (tar_handle->src_fd < 0) | 1045 | if (tar_handle->src_fd < 0) |
1044 | bb_perror_msg_and_die("can't open '%s'", tar_filename); | 1046 | bb_perror_msg_and_die("can't open '%s'", tar_filename); |
diff --git a/coreutils/wc.c b/coreutils/wc.c index fe3f274f8..6e22c66c8 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c | |||
@@ -81,11 +81,11 @@ | |||
81 | * column order in "wc -cmlwL" output: | 81 | * column order in "wc -cmlwL" output: |
82 | */ | 82 | */ |
83 | enum { | 83 | enum { |
84 | WC_LINES = 0, | 84 | WC_LINES = 0, /* -l */ |
85 | WC_WORDS = 1, | 85 | WC_WORDS = 1, /* -w */ |
86 | WC_UNICHARS = 2, | 86 | WC_UNICHARS = 2, /* -m */ |
87 | WC_CHARS = 3, | 87 | WC_BYTES = 3, /* -c */ |
88 | WC_LENGTH = 4, | 88 | WC_LENGTH = 4, /* -L */ |
89 | NUM_WCS = 5, | 89 | NUM_WCS = 5, |
90 | }; | 90 | }; |
91 | 91 | ||
@@ -104,10 +104,10 @@ int wc_main(int argc UNUSED_PARAM, char **argv) | |||
104 | 104 | ||
105 | init_unicode(); | 105 | init_unicode(); |
106 | 106 | ||
107 | print_type = getopt32(argv, "lwcmL"); | 107 | print_type = getopt32(argv, "lwmcL"); |
108 | 108 | ||
109 | if (print_type == 0) { | 109 | if (print_type == 0) { |
110 | print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_CHARS); | 110 | print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_BYTES); |
111 | } | 111 | } |
112 | 112 | ||
113 | argv += optind; | 113 | argv += optind; |
@@ -157,7 +157,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv) | |||
157 | } | 157 | } |
158 | 158 | ||
159 | /* Cater for -c and -m */ | 159 | /* Cater for -c and -m */ |
160 | ++counts[WC_CHARS]; | 160 | ++counts[WC_BYTES]; |
161 | if (unicode_status != UNICODE_ON /* every byte is a new char */ | 161 | if (unicode_status != UNICODE_ON /* every byte is a new char */ |
162 | || (c & 0xc0) != 0x80 /* it isn't a 2nd+ byte of a Unicode char */ | 162 | || (c & 0xc0) != 0x80 /* it isn't a 2nd+ byte of a Unicode char */ |
163 | ) { | 163 | ) { |
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index 5e0fb0d73..0c879f68f 100644 --- a/libbb/vfork_daemon_rexec.c +++ b/libbb/vfork_daemon_rexec.c | |||
@@ -52,6 +52,7 @@ pid_t FAST_FUNC spawn(char **argv) | |||
52 | * Interested party can wait on pid and learn exit code. | 52 | * Interested party can wait on pid and learn exit code. |
53 | * If 111 - then it (most probably) failed to exec */ | 53 | * If 111 - then it (most probably) failed to exec */ |
54 | if (failed) { | 54 | if (failed) { |
55 | safe_waitpid(pid, NULL, 0); /* prevent zombie */ | ||
55 | errno = failed; | 56 | errno = failed; |
56 | return -1; | 57 | return -1; |
57 | } | 58 | } |
diff --git a/loginutils/Config.src b/loginutils/Config.src index 8158bce74..4c771bbc4 100644 --- a/loginutils/Config.src +++ b/loginutils/Config.src | |||
@@ -186,7 +186,6 @@ config GETTY | |||
186 | config LOGIN | 186 | config LOGIN |
187 | bool "login" | 187 | bool "login" |
188 | default y | 188 | default y |
189 | select FEATURE_SUID | ||
190 | select FEATURE_SYSLOG | 189 | select FEATURE_SYSLOG |
191 | help | 190 | help |
192 | login is used when signing onto a system. | 191 | login is used when signing onto a system. |
@@ -229,7 +228,6 @@ config FEATURE_SECURETTY | |||
229 | config PASSWD | 228 | config PASSWD |
230 | bool "passwd" | 229 | bool "passwd" |
231 | default y | 230 | default y |
232 | select FEATURE_SUID | ||
233 | select FEATURE_SYSLOG | 231 | select FEATURE_SYSLOG |
234 | help | 232 | help |
235 | passwd changes passwords for user and group accounts. A normal user | 233 | passwd changes passwords for user and group accounts. A normal user |
@@ -265,7 +263,6 @@ config CHPASSWD | |||
265 | config SU | 263 | config SU |
266 | bool "su" | 264 | bool "su" |
267 | default y | 265 | default y |
268 | select FEATURE_SUID | ||
269 | select FEATURE_SYSLOG | 266 | select FEATURE_SYSLOG |
270 | help | 267 | help |
271 | su is used to become another user during a login session. | 268 | su is used to become another user during a login session. |
@@ -295,7 +292,6 @@ config SULOGIN | |||
295 | config VLOCK | 292 | config VLOCK |
296 | bool "vlock" | 293 | bool "vlock" |
297 | default y | 294 | default y |
298 | select FEATURE_SUID | ||
299 | help | 295 | help |
300 | Build the "vlock" applet which allows you to lock (virtual) terminals. | 296 | Build the "vlock" applet which allows you to lock (virtual) terminals. |
301 | 297 | ||
diff --git a/miscutils/Config.src b/miscutils/Config.src index 4912daf88..da52e14c6 100644 --- a/miscutils/Config.src +++ b/miscutils/Config.src | |||
@@ -170,7 +170,6 @@ config FEATURE_CROND_DIR | |||
170 | config CRONTAB | 170 | config CRONTAB |
171 | bool "crontab" | 171 | bool "crontab" |
172 | default y | 172 | default y |
173 | select FEATURE_SUID | ||
174 | help | 173 | help |
175 | Crontab manipulates the crontab for a particular user. Only | 174 | Crontab manipulates the crontab for a particular user. Only |
176 | the superuser may specify a different user and/or crontab directory. | 175 | the superuser may specify a different user and/or crontab directory. |
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 | } |
diff --git a/networking/ping.c b/networking/ping.c index 3aba4906e..5fc80fe4e 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -394,7 +394,7 @@ static void sendping4(int junk UNUSED_PARAM) | |||
394 | #if ENABLE_PING6 | 394 | #if ENABLE_PING6 |
395 | static void sendping6(int junk UNUSED_PARAM) | 395 | static void sendping6(int junk UNUSED_PARAM) |
396 | { | 396 | { |
397 | struct icmp6_hdr *pkt = alloca(datalen + sizeof(struct icmp6_hdr) + 4); | 397 | struct icmp6_hdr *pkt = G.snd_packet; |
398 | 398 | ||
399 | //memset(pkt, 0, datalen + sizeof(struct icmp6_hdr) + 4); | 399 | //memset(pkt, 0, datalen + sizeof(struct icmp6_hdr) + 4); |
400 | pkt->icmp6_type = ICMP6_ECHO_REQUEST; | 400 | pkt->icmp6_type = ICMP6_ECHO_REQUEST; |
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c index 311f79e7e..0a60261ab 100644 --- a/networking/udhcp/common.c +++ b/networking/udhcp/common.c | |||
@@ -375,7 +375,7 @@ static NOINLINE void attach_option( | |||
375 | new->data = xmalloc(length + OPT_DATA); | 375 | new->data = xmalloc(length + OPT_DATA); |
376 | new->data[OPT_CODE] = optflag->code; | 376 | new->data[OPT_CODE] = optflag->code; |
377 | new->data[OPT_LEN] = length; | 377 | new->data[OPT_LEN] = length; |
378 | memcpy(new->data + OPT_DATA, buffer, length); | 378 | memcpy(new->data + OPT_DATA, (allocated ? allocated : buffer), length); |
379 | 379 | ||
380 | curr = opt_list; | 380 | curr = opt_list; |
381 | while (*curr && (*curr)->data[OPT_CODE] < optflag->code) | 381 | while (*curr && (*curr)->data[OPT_CODE] < optflag->code) |
diff --git a/shell/hush.c b/shell/hush.c index f9f815289..58d2c11a9 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -4123,15 +4123,26 @@ static struct pipe *parse_stream(char **pstring, | |||
4123 | && dest.length == 0 && !dest.has_quoted_part | 4123 | && dest.length == 0 && !dest.has_quoted_part |
4124 | ) { | 4124 | ) { |
4125 | /* This newline can be ignored. But... | 4125 | /* This newline can be ignored. But... |
4126 | * without the below check, interactive shell | 4126 | * Without check #1, interactive shell |
4127 | * will ignore even lines with bare <newline>, | 4127 | * ignores even bare <newline>, |
4128 | * and show the continuation prompt: | 4128 | * and shows the continuation prompt: |
4129 | * ps1_prompt$ <enter> | 4129 | * ps1_prompt$ <enter> |
4130 | * ps2> _ <=== wrong prompt, should be ps1 | 4130 | * ps2> _ <=== wrong, should be ps1 |
4131 | * Without check #2, "cmd & <newline>" | ||
4132 | * is similarly mistreated. | ||
4133 | * (BTW, this makes "cmd & cmd" | ||
4134 | * and "cmd && cmd" non-orthogonal. | ||
4135 | * Really, ask yourself, why | ||
4136 | * "cmd && <newline>" doesn't start | ||
4137 | * cmd but waits for more input? | ||
4138 | * No reason...) | ||
4131 | */ | 4139 | */ |
4132 | struct pipe *pi = ctx.list_head; | 4140 | struct pipe *pi = ctx.list_head; |
4133 | if (pi->num_cmds != 0) | 4141 | if (pi->num_cmds != 0 /* check #1 */ |
4142 | && pi->followup != PIPE_BG /* check #2 */ | ||
4143 | ) { | ||
4134 | continue; | 4144 | continue; |
4145 | } | ||
4135 | } | 4146 | } |
4136 | /* Treat newline as a command separator. */ | 4147 | /* Treat newline as a command separator. */ |
4137 | done_pipe(&ctx, PIPE_SEQ); | 4148 | done_pipe(&ctx, PIPE_SEQ); |
diff --git a/util-linux/Config.src b/util-linux/Config.src index c71b4de38..0f865acfd 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src | |||
@@ -354,7 +354,6 @@ config FEATURE_HWCLOCK_ADJTIME_FHS | |||
354 | config IPCRM | 354 | config IPCRM |
355 | bool "ipcrm" | 355 | bool "ipcrm" |
356 | default y | 356 | default y |
357 | select FEATURE_SUID | ||
358 | help | 357 | help |
359 | The ipcrm utility allows the removal of System V interprocess | 358 | The ipcrm utility allows the removal of System V interprocess |
360 | communication (IPC) objects and the associated data structures | 359 | communication (IPC) objects and the associated data structures |
@@ -364,7 +363,6 @@ config IPCS | |||
364 | bool "ipcs" | 363 | bool "ipcs" |
365 | default y | 364 | default y |
366 | depends on PLATFORM_LINUX | 365 | depends on PLATFORM_LINUX |
367 | select FEATURE_SUID | ||
368 | help | 366 | help |
369 | The ipcs utility is used to provide information on the currently | 367 | The ipcs utility is used to provide information on the currently |
370 | allocated System V interprocess (IPC) objects in the system. | 368 | allocated System V interprocess (IPC) objects in the system. |