diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-22 13:41:59 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-23 04:44:26 +1000 |
commit | 37ec9a93b0d1ba7d3252f36842155194c7f0c4c0 (patch) | |
tree | fc9373551e8e39d8528910dc0192a2333926c86b | |
parent | 95a9140eceb43d5dba205e171d7a5e09f67331ff (diff) | |
download | busybox-w32-37ec9a93b0d1ba7d3252f36842155194c7f0c4c0.tar.gz busybox-w32-37ec9a93b0d1ba7d3252f36842155194c7f0c4c0.tar.bz2 busybox-w32-37ec9a93b0d1ba7d3252f36842155194c7f0c4c0.zip |
fixes up to 1.6.1
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | archival/dpkg.c | 2 | ||||
-rw-r--r-- | coreutils/echo.c | 6 | ||||
-rw-r--r-- | coreutils/test.c | 40 | ||||
-rw-r--r-- | docs/busybox_footer.pod | 2 | ||||
-rw-r--r-- | findutils/grep.c | 32 | ||||
-rw-r--r-- | libbb/correct_password.c | 11 | ||||
-rw-r--r-- | loginutils/login.c | 7 | ||||
-rw-r--r-- | networking/wget.c | 4 | ||||
-rw-r--r-- | shell/Config.in | 4 |
10 files changed, 63 insertions, 47 deletions
@@ -1,6 +1,6 @@ | |||
1 | VERSION = 1 | 1 | VERSION = 1 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 1 |
4 | EXTRAVERSION = | 4 | EXTRAVERSION = |
5 | NAME = Unnamed | 5 | NAME = Unnamed |
6 | 6 | ||
diff --git a/archival/dpkg.c b/archival/dpkg.c index dcbd0d162..0ab54c30e 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -1550,7 +1550,7 @@ static void configure_package(deb_file_t *deb_file) | |||
1550 | /* Run the postinst script */ | 1550 | /* Run the postinst script */ |
1551 | if (run_package_script(package_name, "postinst") != 0) { | 1551 | if (run_package_script(package_name, "postinst") != 0) { |
1552 | /* TODO: handle failure gracefully */ | 1552 | /* TODO: handle failure gracefully */ |
1553 | bb_error_msg_and_die("postrm failure.. set status to what?"); | 1553 | bb_error_msg_and_die("postinst failure.. set status to what?"); |
1554 | } | 1554 | } |
1555 | /* Change status to reflect success */ | 1555 | /* Change status to reflect success */ |
1556 | set_status(status_num, "install", 1); | 1556 | set_status(status_num, "install", 1); |
diff --git a/coreutils/echo.c b/coreutils/echo.c index 9aad2c2ba..085e8516c 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c | |||
@@ -33,7 +33,9 @@ int bb_echo(char **argv) | |||
33 | eflag = '\\', | 33 | eflag = '\\', |
34 | nflag = 1, /* 1 -- print '\n' */ | 34 | nflag = 1, /* 1 -- print '\n' */ |
35 | }; | 35 | }; |
36 | ++argv; | 36 | arg = *++argv; |
37 | if (!arg) | ||
38 | goto newline_ret; | ||
37 | #else | 39 | #else |
38 | const char *p; | 40 | const char *p; |
39 | char nflag = 1; | 41 | char nflag = 1; |
@@ -107,9 +109,7 @@ int bb_echo(char **argv) | |||
107 | putchar(' '); | 109 | putchar(' '); |
108 | } | 110 | } |
109 | 111 | ||
110 | #if ENABLE_FEATURE_FANCY_ECHO | ||
111 | newline_ret: | 112 | newline_ret: |
112 | #endif | ||
113 | if (nflag) { | 113 | if (nflag) { |
114 | putchar('\n'); | 114 | putchar('\n'); |
115 | } | 115 | } |
diff --git a/coreutils/test.c b/coreutils/test.c index fd10e6845..c26e7e572 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -182,19 +182,23 @@ static void initialize_group_array(void); | |||
182 | int bb_test(int argc, char **argv) | 182 | int bb_test(int argc, char **argv) |
183 | { | 183 | { |
184 | int res; | 184 | int res; |
185 | char *arg0; | ||
186 | bool _off; | ||
185 | 187 | ||
186 | if (LONE_CHAR(argv[0], '[')) { | 188 | arg0 = strrchr(argv[0], '/'); |
189 | if (!arg0++) arg0 = argv[0]; | ||
190 | if (arg0[0] == '[') { | ||
187 | --argc; | 191 | --argc; |
188 | if (NOT_LONE_CHAR(argv[argc], ']')) { | 192 | if (!arg0[1]) { /* "[" ? */ |
189 | bb_error_msg("missing ]"); | 193 | if (NOT_LONE_CHAR(argv[argc], ']')) { |
190 | return 2; | 194 | bb_error_msg("missing ]"); |
191 | } | 195 | return 2; |
192 | argv[argc] = NULL; | 196 | } |
193 | } else if (strcmp(argv[0], "[[") == 0) { | 197 | } else { /* assuming "[[" */ |
194 | --argc; | 198 | if (strcmp(argv[argc], "]]") != 0) { |
195 | if (strcmp(argv[argc], "]]")) { | 199 | bb_error_msg("missing ]]"); |
196 | bb_error_msg("missing ]]"); | 200 | return 2; |
197 | return 2; | 201 | } |
198 | } | 202 | } |
199 | argv[argc] = NULL; | 203 | argv[argc] = NULL; |
200 | } | 204 | } |
@@ -219,15 +223,19 @@ int bb_test(int argc, char **argv) | |||
219 | if (argc == 2) | 223 | if (argc == 2) |
220 | return *argv[1] == '\0'; | 224 | return *argv[1] == '\0'; |
221 | //assert(argc); | 225 | //assert(argc); |
222 | if (LONE_CHAR(argv[1], '!')) { | 226 | /* remember if we saw argc==4 which wants *no* '!' test */ |
223 | bool _off; | 227 | _off = argc - 4; |
228 | if (_off ? | ||
229 | (LONE_CHAR(argv[1], '!')) | ||
230 | : (argv[1][0] != '!' || argv[1][1] != '\0')) | ||
231 | { | ||
224 | if (argc == 3) | 232 | if (argc == 3) |
225 | return *argv[2] != '\0'; | 233 | return *argv[2] != '\0'; |
226 | _off = argc - 4; | 234 | |
227 | t_lex(argv[2 + _off]); | 235 | t_lex(argv[2 + _off]); |
228 | if (t_wp_op && t_wp_op->op_type == BINOP) { | 236 | if (t_wp_op && t_wp_op->op_type == BINOP) { |
229 | t_wp = &argv[1 + _off]; | 237 | t_wp = &argv[1 + _off]; |
230 | return binop() == 0; | 238 | return binop() == _off; |
231 | } | 239 | } |
232 | } | 240 | } |
233 | t_wp = &argv[1]; | 241 | t_wp = &argv[1]; |
@@ -378,7 +386,7 @@ static int binop(void) | |||
378 | static int filstat(char *nm, enum token mode) | 386 | static int filstat(char *nm, enum token mode) |
379 | { | 387 | { |
380 | struct stat s; | 388 | struct stat s; |
381 | int i; | 389 | int i = i; /* gcc 3.x thinks it can be used uninitialized */ |
382 | 390 | ||
383 | if (mode == FILSYM) { | 391 | if (mode == FILSYM) { |
384 | #ifdef S_IFLNK | 392 | #ifdef S_IFLNK |
diff --git a/docs/busybox_footer.pod b/docs/busybox_footer.pod index c678e21ad..15e3a4f32 100644 --- a/docs/busybox_footer.pod +++ b/docs/busybox_footer.pod | |||
@@ -254,5 +254,5 @@ Tito Ragusa <farmatito@tiscali.it> | |||
254 | 254 | ||
255 | =cut | 255 | =cut |
256 | 256 | ||
257 | # $LastChangedDate$ | 257 | # $LastChangedDate: 2007-01-22 18:12:56 +0100 (Пнд, 22 Янв 2007) $ |
258 | 258 | ||
diff --git a/findutils/grep.c b/findutils/grep.c index 59508607f..75425b4df 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
@@ -48,11 +48,11 @@ enum { | |||
48 | OPTBIT_L, | 48 | OPTBIT_L, |
49 | OPTBIT_o, | 49 | OPTBIT_o, |
50 | OPTBIT_r, | 50 | OPTBIT_r, |
51 | USE_FEATURE_GREP_CONTEXT(OPTBIT_A ,) | 51 | USE_FEATURE_GREP_CONTEXT( OPTBIT_A ,) |
52 | USE_FEATURE_GREP_CONTEXT(OPTBIT_B ,) | 52 | USE_FEATURE_GREP_CONTEXT( OPTBIT_B ,) |
53 | USE_FEATURE_GREP_CONTEXT(OPTBIT_C ,) | 53 | USE_FEATURE_GREP_CONTEXT( OPTBIT_C ,) |
54 | USE_FEATURE_GREP_CONTEXT(OPTBIT_E ,) | 54 | USE_FEATURE_GREP_EGREP_ALIAS(OPTBIT_E ,) |
55 | USE_DESKTOP( OPTBIT_w ,) | 55 | USE_DESKTOP( OPTBIT_w ,) |
56 | OPT_l = 1 << OPTBIT_l, | 56 | OPT_l = 1 << OPTBIT_l, |
57 | OPT_n = 1 << OPTBIT_n, | 57 | OPT_n = 1 << OPTBIT_n, |
58 | OPT_q = 1 << OPTBIT_q, | 58 | OPT_q = 1 << OPTBIT_q, |
@@ -68,19 +68,19 @@ enum { | |||
68 | OPT_L = 1 << OPTBIT_L, | 68 | OPT_L = 1 << OPTBIT_L, |
69 | OPT_o = 1 << OPTBIT_o, | 69 | OPT_o = 1 << OPTBIT_o, |
70 | OPT_r = 1 << OPTBIT_r, | 70 | OPT_r = 1 << OPTBIT_r, |
71 | OPT_A = USE_FEATURE_GREP_CONTEXT((1 << OPTBIT_A)) + 0, | 71 | OPT_A = USE_FEATURE_GREP_CONTEXT( (1 << OPTBIT_A)) + 0, |
72 | OPT_B = USE_FEATURE_GREP_CONTEXT((1 << OPTBIT_B)) + 0, | 72 | OPT_B = USE_FEATURE_GREP_CONTEXT( (1 << OPTBIT_B)) + 0, |
73 | OPT_C = USE_FEATURE_GREP_CONTEXT((1 << OPTBIT_C)) + 0, | 73 | OPT_C = USE_FEATURE_GREP_CONTEXT( (1 << OPTBIT_C)) + 0, |
74 | OPT_E = USE_FEATURE_GREP_CONTEXT((1 << OPTBIT_E)) + 0, | 74 | OPT_E = USE_FEATURE_GREP_EGREP_ALIAS((1 << OPTBIT_E)) + 0, |
75 | OPT_w = USE_DESKTOP( (1 << OPTBIT_w)) + 0, | 75 | OPT_w = USE_DESKTOP( (1 << OPTBIT_w)) + 0, |
76 | }; | 76 | }; |
77 | 77 | ||
78 | #define PRINT_FILES_WITH_MATCHES (option_mask32 & OPT_l) | 78 | #define PRINT_FILES_WITH_MATCHES (option_mask32 & OPT_l) |
79 | #define PRINT_LINE_NUM (option_mask32 & OPT_n) | 79 | #define PRINT_LINE_NUM (option_mask32 & OPT_n) |
80 | #define BE_QUIET (option_mask32 & OPT_q) | 80 | #define BE_QUIET (option_mask32 & OPT_q) |
81 | #define SUPPRESS_ERR_MSGS (option_mask32 & OPT_s) | 81 | #define SUPPRESS_ERR_MSGS (option_mask32 & OPT_s) |
82 | #define PRINT_MATCH_COUNTS (option_mask32 & OPT_c) | 82 | #define PRINT_MATCH_COUNTS (option_mask32 & OPT_c) |
83 | #define FGREP_FLAG (option_mask32 & OPT_F) | 83 | #define FGREP_FLAG (option_mask32 & OPT_F) |
84 | #define PRINT_FILES_WITHOUT_MATCHES (option_mask32 & OPT_L) | 84 | #define PRINT_FILES_WITHOUT_MATCHES (option_mask32 & OPT_L) |
85 | 85 | ||
86 | typedef unsigned char byte_t; | 86 | typedef unsigned char byte_t; |
diff --git a/libbb/correct_password.c b/libbb/correct_password.c index c515b26af..af6ff076d 100644 --- a/libbb/correct_password.c +++ b/libbb/correct_password.c | |||
@@ -31,9 +31,10 @@ | |||
31 | #include "libbb.h" | 31 | #include "libbb.h" |
32 | 32 | ||
33 | /* Ask the user for a password. | 33 | /* Ask the user for a password. |
34 | Return 1 if the user gives the correct password for entry PW, | 34 | * Return 1 if the user gives the correct password for entry PW, |
35 | 0 if not. Return 1 without asking for a password if run by UID 0 | 35 | * 0 if not. Return 1 without asking if PW has an empty password. |
36 | or if PW has an empty password. */ | 36 | * |
37 | * NULL pw means "just fake it for login with bad username" */ | ||
37 | 38 | ||
38 | int correct_password(const struct passwd *pw) | 39 | int correct_password(const struct passwd *pw) |
39 | { | 40 | { |
@@ -46,6 +47,9 @@ int correct_password(const struct passwd *pw) | |||
46 | char buffer[256]; | 47 | char buffer[256]; |
47 | #endif | 48 | #endif |
48 | 49 | ||
50 | correct = "aa"; /* fake salt. crypt() can choke otherwise */ | ||
51 | if (!pw) | ||
52 | goto fake_it; /* "aa" will never match */ | ||
49 | correct = pw->pw_passwd; | 53 | correct = pw->pw_passwd; |
50 | #if ENABLE_FEATURE_SHADOWPASSWDS | 54 | #if ENABLE_FEATURE_SHADOWPASSWDS |
51 | if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) { | 55 | if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) { |
@@ -59,6 +63,7 @@ int correct_password(const struct passwd *pw) | |||
59 | if (!correct || correct[0] == '\0') | 63 | if (!correct || correct[0] == '\0') |
60 | return 1; | 64 | return 1; |
61 | 65 | ||
66 | fake_it: | ||
62 | unencrypted = bb_askpass(0, "Password: "); | 67 | unencrypted = bb_askpass(0, "Password: "); |
63 | if (!unencrypted) { | 68 | if (!unencrypted) { |
64 | return 0; | 69 | return 0; |
diff --git a/loginutils/login.c b/loginutils/login.c index 142695008..b6924b641 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -276,8 +276,8 @@ int login_main(int argc, char **argv) | |||
276 | 276 | ||
277 | pw = getpwnam(username); | 277 | pw = getpwnam(username); |
278 | if (!pw) { | 278 | if (!pw) { |
279 | safe_strncpy(username, "UNKNOWN", sizeof(username)); | 279 | strcpy(username, "UNKNOWN"); |
280 | goto auth_failed; | 280 | goto fake_it; |
281 | } | 281 | } |
282 | 282 | ||
283 | if (pw->pw_passwd[0] == '!' || pw->pw_passwd[0] == '*') | 283 | if (pw->pw_passwd[0] == '!' || pw->pw_passwd[0] == '*') |
@@ -292,11 +292,10 @@ int login_main(int argc, char **argv) | |||
292 | /* Don't check the password if password entry is empty (!) */ | 292 | /* Don't check the password if password entry is empty (!) */ |
293 | if (!pw->pw_passwd[0]) | 293 | if (!pw->pw_passwd[0]) |
294 | break; | 294 | break; |
295 | 295 | fake_it: | |
296 | /* authorization takes place here */ | 296 | /* authorization takes place here */ |
297 | if (correct_password(pw)) | 297 | if (correct_password(pw)) |
298 | break; | 298 | break; |
299 | |||
300 | auth_failed: | 299 | auth_failed: |
301 | opt &= ~LOGIN_OPT_f; | 300 | opt &= ~LOGIN_OPT_f; |
302 | bb_do_delay(FAIL_DELAY); | 301 | bb_do_delay(FAIL_DELAY); |
diff --git a/networking/wget.c b/networking/wget.c index 2c060d77d..c06a09d72 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -267,11 +267,11 @@ int wget_main(int argc, char **argv) | |||
267 | #if ENABLE_FEATURE_WGET_AUTHENTICATION | 267 | #if ENABLE_FEATURE_WGET_AUTHENTICATION |
268 | if (target.user) { | 268 | if (target.user) { |
269 | fprintf(sfp, "Authorization: Basic %s\r\n", | 269 | fprintf(sfp, "Authorization: Basic %s\r\n", |
270 | base64enc((unsigned char*)target.user, buf, sizeof(buf))); | 270 | base64enc((unsigned char*)target.user, buf, strlen(target.user))); |
271 | } | 271 | } |
272 | if (use_proxy && server.user) { | 272 | if (use_proxy && server.user) { |
273 | fprintf(sfp, "Proxy-Authorization: Basic %s\r\n", | 273 | fprintf(sfp, "Proxy-Authorization: Basic %s\r\n", |
274 | base64enc((unsigned char*)server.user, buf, sizeof(buf))); | 274 | base64enc((unsigned char*)server.user, buf, strlen(server.user))); |
275 | } | 275 | } |
276 | #endif | 276 | #endif |
277 | 277 | ||
diff --git a/shell/Config.in b/shell/Config.in index 90479013e..0689b4ec2 100644 --- a/shell/Config.in +++ b/shell/Config.in | |||
@@ -179,6 +179,7 @@ config HUSH | |||
179 | config HUSH_HELP | 179 | config HUSH_HELP |
180 | bool "help builtin" | 180 | bool "help builtin" |
181 | default n | 181 | default n |
182 | depends on HUSH | ||
182 | help | 183 | help |
183 | Enable help builtin in hush. Code size + ~1 kbyte. | 184 | Enable help builtin in hush. Code size + ~1 kbyte. |
184 | 185 | ||
@@ -206,18 +207,21 @@ config HUSH_JOB | |||
206 | config HUSH_TICK | 207 | config HUSH_TICK |
207 | bool "Process substitution" | 208 | bool "Process substitution" |
208 | default n | 209 | default n |
210 | depends on HUSH | ||
209 | help | 211 | help |
210 | Enable process substitution `command` and $(command) in hush. | 212 | Enable process substitution `command` and $(command) in hush. |
211 | 213 | ||
212 | config HUSH_IF | 214 | config HUSH_IF |
213 | bool "Support if/then/elif/else/fi" | 215 | bool "Support if/then/elif/else/fi" |
214 | default n | 216 | default n |
217 | depends on HUSH | ||
215 | help | 218 | help |
216 | Enable if/then/elif/else/fi in hush. | 219 | Enable if/then/elif/else/fi in hush. |
217 | 220 | ||
218 | config HUSH_LOOPS | 221 | config HUSH_LOOPS |
219 | bool "Support for, while and until loops" | 222 | bool "Support for, while and until loops" |
220 | default n | 223 | default n |
224 | depends on HUSH | ||
221 | help | 225 | help |
222 | Enable for, while and until loops in hush. | 226 | Enable for, while and until loops in hush. |
223 | 227 | ||