- Timestamp:
- Jul 26, 2011, 1:25:42 AM (14 years ago)
- Location:
- branches/2.2.9/mindi-busybox
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/Config.in
r2725 r2859 127 127 bool "Don't use /usr" 128 128 default n 129 depends on FEATURE_INSTALLER130 129 help 131 130 Disable use of /usr. busybox --install and "make install" -
branches/2.2.9/mindi-busybox/Makefile
r2823 r2859 1 1 VERSION = 1 2 2 PATCHLEVEL = 18 3 SUBLEVEL = 33 SUBLEVEL = 5 4 4 EXTRAVERSION = -rPBREV 5 5 NAME = Unnamed -
branches/2.2.9/mindi-busybox/coreutils/cksum.c
r2725 r2859 39 39 #define read_buf bb_common_bufsiz1 40 40 while ((bytes_read = safe_read(fd, read_buf, sizeof(read_buf))) > 0) { 41 length += bytes_read; 41 42 crc = crc32_block_endian1(crc, read_buf, bytes_read, crc32_table); 42 43 } -
branches/2.2.9/mindi-busybox/modutils/modutils-24.c
r2725 r2859 2475 2475 p = val; 2476 2476 while (*p != 0) { 2477 char sv_ch; 2477 2478 char *endp; 2478 2479 … … 2483 2484 case 's': 2484 2485 len = strcspn(p, ","); 2486 sv_ch = p[len]; 2485 2487 p[len] = 0; 2486 2488 obj_string_patch(f, sym->secidx, … … 2488 2490 loc += tgt_sizeof_char_p; 2489 2491 p += len; 2492 *p = sv_ch; 2490 2493 break; 2491 2494 case 'c': 2492 2495 len = strcspn(p, ","); 2496 sv_ch = p[len]; 2493 2497 p[len] = 0; 2494 2498 if (len >= charssize) … … 2498 2502 loc += charssize; 2499 2503 p += len; 2504 *p = sv_ch; 2500 2505 break; 2501 2506 case 'b': -
branches/2.2.9/mindi-busybox/networking/wget.c
r2725 r2859 447 447 static void NOINLINE retrieve_file_data(FILE *dfp, int output_fd) 448 448 { 449 char buf[ 512];449 char buf[4*1024]; /* made bigger to speed up local xfers */ 450 450 #if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT 451 451 # if ENABLE_FEATURE_WGET_TIMEOUT … … 456 456 polldata.fd = fileno(dfp); 457 457 polldata.events = POLLIN | POLLPRI; 458 ndelay_on(polldata.fd);459 458 #endif 460 459 progress_meter(PROGRESS_START); … … 465 464 /* Loops only if chunked */ 466 465 while (1) { 466 467 #if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT 468 ndelay_on(polldata.fd); 469 #endif 467 470 while (1) { 468 471 int n; … … 494 497 } 495 498 #endif 499 /* fread internally uses read loop, which in our case 500 * is usually exited when we get EAGAIN. 501 * In this case, libc sets error marker on the stream. 502 * Need to clear it before next fread to avoid possible 503 * rare false positive ferror below. Rare because usually 504 * fread gets more than zero bytes, and we don't fall 505 * into if (n <= 0) ... 506 */ 507 clearerr(dfp); 508 errno = 0; 496 509 n = safe_fread(buf, rdsz, dfp); 510 /* man fread: 511 * If error occurs, or EOF is reached, the return value 512 * is a short item count (or zero). 513 * fread does not distinguish between EOF and error. 514 */ 497 515 if (n <= 0) { 498 if (ferror(dfp)) { 499 /* perror will not work: ferror doesn't set errno */ 500 bb_error_msg_and_die(bb_msg_read_error); 501 } 502 break; 516 #if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT 517 if (errno == EAGAIN) /* poll lied, there is no data? */ 518 continue; /* yes */ 519 #endif 520 if (ferror(dfp)) 521 bb_perror_msg_and_die(bb_msg_read_error); 522 break; /* EOF, not error */ 503 523 } 524 504 525 xwrite(output_fd, buf, n); 505 526 #if ENABLE_FEATURE_WGET_STATUSBAR … … 507 528 progress_meter(PROGRESS_BUMP); 508 529 #endif 509 if (G.got_clen) 530 if (G.got_clen) { 510 531 G.content_len -= n; 511 } 532 if (G.content_len == 0) 533 break; 534 } 535 } 536 #if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT 537 ndelay_off(polldata.fd); 538 #endif 512 539 513 540 if (!G.chunked) … … 707 734 target.host, user_agent); 708 735 736 /* Ask server to close the connection as soon as we are done 737 * (IOW: we do not intend to send more requests) 738 */ 739 fprintf(sfp, "Connection: close\r\n"); 740 709 741 #if ENABLE_FEATURE_WGET_AUTHENTICATION 710 742 if (target.user) { … … 720 752 if (G.beg_range) 721 753 fprintf(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range); 754 722 755 #if ENABLE_FEATURE_WGET_LONG_OPTIONS 723 756 if (extra_headers) … … 726 759 if (opt & WGET_OPT_POST_DATA) { 727 760 char *estr = URL_escape(post_data); 728 fprintf(sfp, "Content-Type: application/x-www-form-urlencoded\r\n"); 729 fprintf(sfp, "Content-Length: %u\r\n" "\r\n" "%s", 730 (int) strlen(estr), estr); 731 /*fprintf(sfp, "Connection: Keep-Alive\r\n\r\n");*/ 732 /*fprintf(sfp, "%s\r\n", estr);*/ 761 fprintf(sfp, 762 "Content-Type: application/x-www-form-urlencoded\r\n" 763 "Content-Length: %u\r\n" 764 "\r\n" 765 "%s", 766 (int) strlen(estr), estr 767 ); 733 768 free(estr); 734 769 } else 735 770 #endif 736 { /* If "Connection:" is needed, document why */737 fprintf(sfp, /* "Connection: close\r\n" */"\r\n");771 { 772 fprintf(sfp, "\r\n"); 738 773 } 739 774 -
branches/2.2.9/mindi-busybox/procps/fuser.c
r2725 r2859 272 272 goto file; 273 273 sprintf(path, "/proc/net/%s", tproto); 274 if (access(path, R_OK) != 0) { /* PORT/PROTO */274 if (access(path, R_OK) == 0) { /* PORT/PROTO */ 275 275 scan_proc_net(path, port); 276 276 } else { /* FILE */ -
branches/2.2.9/mindi-busybox/scripts/kconfig/mconf.c
r2725 r2859 257 257 "\n"); 258 258 259 static char buf[4096 ], *bufptr = buf;259 static char buf[4096*10], *bufptr = buf; 260 260 static char input_buf[4096]; 261 261 static const char filename[] = ".config"; -
branches/2.2.9/mindi-busybox/scripts/mkconfigs
r2725 r2859 43 43 static const char bbconfig_config[] ALIGN1 =" 44 44 45 grep '^#\? \?CONFIG_' "$config" \45 grep -e '^# CONFIG_' -e '^CONFIG_' "$config" \ 46 46 | sed -e 's/\"/\\\"/g' -e 's/^/"/' -e 's/$/\\n"/' 47 47 … … 64 64 static const char bbconfig_config_bz2[] ALIGN1 = {" 65 65 66 grep '^#\? \?CONFIG_' "$config" \66 grep -e '^# CONFIG_' -e '^CONFIG_' "$config" \ 67 67 | bzip2 -1 | dd bs=2 skip=1 2>/dev/null \ 68 68 | od -v -t x1 \ -
branches/2.2.9/mindi-busybox/shell/hush.c
r2725 r2859 428 428 #define NULL_O_STRING { NULL } 429 429 430 #ifndef debug_printf_parse 431 static const char *const assignment_flag[] = { 432 "MAYBE_ASSIGNMENT", 433 "DEFINITELY_ASSIGNMENT", 434 "NOT_ASSIGNMENT", 435 "WORD_IS_KEYWORD", 436 }; 437 #endif 438 430 439 /* I can almost use ordinary FILE*. Is open_memstream() universally 431 440 * available? Where is it documented? */ … … 2886 2895 static const struct reserved_combo reserved_list[] = { 2887 2896 # if ENABLE_HUSH_IF 2888 { "!", RES_NONE, NOT_ASSIGNMENT , 0 },2889 { "if", RES_IF, WORD_IS_KEYWORD, FLAG_THEN | FLAG_START },2890 { "then", RES_THEN, WORD_IS_KEYWORD, FLAG_ELIF | FLAG_ELSE | FLAG_FI },2891 { "elif", RES_ELIF, WORD_IS_KEYWORD, FLAG_THEN },2892 { "else", RES_ELSE, WORD_IS_KEYWORD, FLAG_FI },2893 { "fi", RES_FI, NOT_ASSIGNMENT , FLAG_END },2897 { "!", RES_NONE, NOT_ASSIGNMENT , 0 }, 2898 { "if", RES_IF, MAYBE_ASSIGNMENT, FLAG_THEN | FLAG_START }, 2899 { "then", RES_THEN, MAYBE_ASSIGNMENT, FLAG_ELIF | FLAG_ELSE | FLAG_FI }, 2900 { "elif", RES_ELIF, MAYBE_ASSIGNMENT, FLAG_THEN }, 2901 { "else", RES_ELSE, MAYBE_ASSIGNMENT, FLAG_FI }, 2902 { "fi", RES_FI, NOT_ASSIGNMENT , FLAG_END }, 2894 2903 # endif 2895 2904 # if ENABLE_HUSH_LOOPS 2896 { "for", RES_FOR, NOT_ASSIGNMENT , FLAG_IN | FLAG_DO | FLAG_START },2897 { "while", RES_WHILE, WORD_IS_KEYWORD, FLAG_DO | FLAG_START },2898 { "until", RES_UNTIL, WORD_IS_KEYWORD, FLAG_DO | FLAG_START },2899 { "in", RES_IN, NOT_ASSIGNMENT , FLAG_DO },2900 { "do", RES_DO, WORD_IS_KEYWORD, FLAG_DONE },2901 { "done", RES_DONE, NOT_ASSIGNMENT , FLAG_END },2905 { "for", RES_FOR, NOT_ASSIGNMENT , FLAG_IN | FLAG_DO | FLAG_START }, 2906 { "while", RES_WHILE, MAYBE_ASSIGNMENT, FLAG_DO | FLAG_START }, 2907 { "until", RES_UNTIL, MAYBE_ASSIGNMENT, FLAG_DO | FLAG_START }, 2908 { "in", RES_IN, NOT_ASSIGNMENT , FLAG_DO }, 2909 { "do", RES_DO, MAYBE_ASSIGNMENT, FLAG_DONE }, 2910 { "done", RES_DONE, NOT_ASSIGNMENT , FLAG_END }, 2902 2911 # endif 2903 2912 # if ENABLE_HUSH_CASE 2904 { "case", RES_CASE, NOT_ASSIGNMENT , FLAG_MATCH | FLAG_START },2905 { "esac", RES_ESAC, NOT_ASSIGNMENT , FLAG_END },2913 { "case", RES_CASE, NOT_ASSIGNMENT , FLAG_MATCH | FLAG_START }, 2914 { "esac", RES_ESAC, NOT_ASSIGNMENT , FLAG_END }, 2906 2915 # endif 2907 2916 }; … … 2969 2978 ctx->old_flag = r->flag; 2970 2979 word->o_assignment = r->assignment_flag; 2980 debug_printf_parse("word->o_assignment='%s'\n", assignment_flag[word->o_assignment]); 2971 2981 2972 2982 if (ctx->old_flag & FLAG_END) { … … 3035 3045 ctx->pending_redirect = NULL; 3036 3046 } else { 3037 /* If this word wasn't an assignment, next ones definitely3038 * can't be assignments. Even if they look like ones. */3039 if (word->o_assignment != DEFINITELY_ASSIGNMENT3040 && word->o_assignment != WORD_IS_KEYWORD3041 ) {3042 word->o_assignment = NOT_ASSIGNMENT;3043 } else {3044 if (word->o_assignment == DEFINITELY_ASSIGNMENT)3045 command->assignment_cnt++;3046 word->o_assignment = MAYBE_ASSIGNMENT;3047 }3048 3049 3047 #if HAS_KEYWORDS 3050 3048 # if ENABLE_HUSH_CASE … … 3066 3064 # endif 3067 3065 ) { 3068 debug_printf_parse("checking '%s' for reserved-ness\n", word->data); 3069 if (reserved_word(word, ctx)) { 3066 int reserved = reserved_word(word, ctx); 3067 debug_printf_parse("checking for reserved-ness: %d\n", reserved); 3068 if (reserved) { 3070 3069 o_reset_to_empty_unquoted(word); 3071 3070 debug_printf_parse("done_word return %d\n", … … 3088 3087 return 1; 3089 3088 } 3089 3090 /* If this word wasn't an assignment, next ones definitely 3091 * can't be assignments. Even if they look like ones. */ 3092 if (word->o_assignment != DEFINITELY_ASSIGNMENT 3093 && word->o_assignment != WORD_IS_KEYWORD 3094 ) { 3095 word->o_assignment = NOT_ASSIGNMENT; 3096 } else { 3097 if (word->o_assignment == DEFINITELY_ASSIGNMENT) { 3098 command->assignment_cnt++; 3099 debug_printf_parse("++assignment_cnt=%d\n", command->assignment_cnt); 3100 } 3101 debug_printf_parse("word->o_assignment was:'%s'\n", assignment_flag[word->o_assignment]); 3102 word->o_assignment = MAYBE_ASSIGNMENT; 3103 } 3104 debug_printf_parse("word->o_assignment='%s'\n", assignment_flag[word->o_assignment]); 3105 3090 3106 if (word->has_quoted_part 3091 3107 /* optimization: and if it's ("" or '') or ($v... or `cmd`...): */ … … 4106 4122 ) { 4107 4123 dest.o_assignment = DEFINITELY_ASSIGNMENT; 4124 debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]); 4108 4125 } 4109 4126 continue; … … 4155 4172 } 4156 4173 dest.o_assignment = MAYBE_ASSIGNMENT; 4174 debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]); 4157 4175 ch = ';'; 4158 4176 /* note: if (is_blank) continue; … … 4204 4222 done_pipe(&ctx, PIPE_SEQ); 4205 4223 dest.o_assignment = MAYBE_ASSIGNMENT; 4224 debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]); 4206 4225 /* Do we sit outside of any if's, loops or case's? */ 4207 4226 if (!HAS_KEYWORDS … … 4310 4329 * cannot be an assignment */ 4311 4330 dest.o_assignment = NOT_ASSIGNMENT; 4331 debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]); 4312 4332 } 4313 4333 … … 4407 4427 * with an assignment */ 4408 4428 dest.o_assignment = MAYBE_ASSIGNMENT; 4429 debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]); 4409 4430 break; 4410 4431 case '&': … … 7293 7314 #if ENABLE_HUSH_LOOPS 7294 7315 /* Beware of "while false; true; do ..."! */ 7295 if (pi->next && pi->next->res_word == RES_DO) { 7316 if (pi->next 7317 && (pi->next->res_word == RES_DO || pi->next->res_word == RES_DONE) 7318 /* (the second check above is needed for "while ...; do \n done" case) */ 7319 ) { 7296 7320 if (rword == RES_WHILE) { 7297 7321 if (rcode) { -
branches/2.2.9/mindi-busybox/sysklogd/klogd.c
r2725 r2859 151 151 klogd_open(); 152 152 openlog("kernel", 0, LOG_KERN); 153 /* 154 * glibc problem: for some reason, glibc changes LOG_KERN to LOG_USER 155 * above. The logic behind this is that standard 156 * http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html 157 * says the following about openlog and syslog: 158 * "LOG_USER 159 * Messages generated by arbitrary processes. 160 * This is the default facility identifier if none is specified." 161 * 162 * I believe glibc misinterpreted this text as "if openlog's 163 * third parameter is 0 (=LOG_KERN), treat it as LOG_USER". 164 * Whereas it was meant to say "if *syslog* is called with facility 165 * 0 in its 1st parameter without prior call to openlog, then perform 166 * implicit openlog(LOG_USER)". 167 * 168 * As a result of this, eh, feature, standard klogd was forced 169 * to open-code its own openlog and syslog implementation (!). 170 * 171 * Note that prohibiting openlog(LOG_KERN) on libc level does not 172 * add any security: any process can open a socket to "/dev/log" 173 * and write a string "<0>Voila, a LOG_KERN + LOG_EMERG message" 174 * 175 * Google code search tells me there is no widespread use of 176 * openlog("foo", 0, 0), thus fixing glibc won't break userspace. 177 * 178 * The bug against glibc was filed: 179 * bugzilla.redhat.com/show_bug.cgi?id=547000 180 */ 153 181 154 182 if (i) 155 183 klogd_setloglevel(i); 156 184 157 bb_signals(BB_FATAL_SIGS, record_signo);158 185 signal(SIGHUP, SIG_IGN); 186 /* We want klogd_read to not be restarted, thus _norestart: */ 187 bb_signals_recursive_norestart(BB_FATAL_SIGS, record_signo); 159 188 160 189 syslog(LOG_NOTICE, "klogd started: %s", bb_banner);
Note:
See TracChangeset
for help on using the changeset viewer.