source:
clfs-embedded/patches/busybox-1.12.1-fixes-1.patch@
d599ff5
Last change on this file since d599ff5 was 2567553, checked in by , 16 years ago | |
---|---|
|
|
File size: 13.0 KB |
-
coreutils/basename.c
Submitted By: Joe Ciccone <jciccone@gmail.com> Date: 2008-11-08 Origin: Busybox FTP Initial Package Version: 1.12.1 Upstream Status: From Upstream Descriprion: Apply fixes from upstream busybox-1.12.1-basename.patch busybox-1.12.1-grep.patch busybox-1.12.1-lineedit.patch busybox-1.12.1-login.patch busybox-1.12.1-modprobe.patch busybox-1.12.1-standalone.patch busybox-1.12.1-vi.patch diff -Naur busybox-1.12.1.orig/coreutils/basename.c busybox-1.12.1/coreutils/basename.c
old new 48 48 49 49 /* puts(s) will do, but we can do without stdio this way: */ 50 50 s[m++] = '\n'; 51 return full_write(STDOUT_FILENO, s, m) == (ssize_t)m;51 return full_write(STDOUT_FILENO, s, m) != (ssize_t)m; 52 52 } -
coreutils/env.c
diff -Naur busybox-1.12.1.orig/coreutils/env.c busybox-1.12.1/coreutils/env.c
old new 29 29 * - use xfunc_error_retval 30 30 */ 31 31 32 /* This is a NOEXEC applet. Be very careful! */ 33 32 34 #include "libbb.h" 33 35 34 36 #if ENABLE_FEATURE_ENV_LONG_OPTIONS … … 119 121 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 120 122 * SUCH DAMAGE. 121 123 */ 122 123 -
busybox-1.12.1
diff -Naur busybox-1.12.1.orig/editors/vi.c busybox-1.12.1/editors/vi.c
old new 291 291 #define INIT_G() do { \ 292 292 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ 293 293 last_file_modified = -1; \ 294 /* "" but has space for 2 chars */ \ 295 USE_FEATURE_VI_SEARCH(last_search_pattern = xzalloc(2);) \ 294 296 } while (0) 295 297 296 298 … … 2974 2976 const char *msg = msg; // for compiler 2975 2977 char c1, *p, *q, *save_dot; 2976 2978 char buf[12]; 2977 int dir = dir; // for compiler2979 int dir; 2978 2980 int cnt, i, j; 2979 2981 2980 2982 // c1 = c; // quiet the compiler … … 3316 3318 q = get_input_line(buf); // get input line- use "status line" 3317 3319 if (q[0] && !q[1]) { 3318 3320 if (last_search_pattern[0]) 3319 3321 last_search_pattern[0] = c; 3320 3322 goto dc3; // if no pat re-use old pat 3321 3323 } 3322 3324 if (q[0]) { // strlen(q) > 1: new pat- save it and find … … 3346 3348 do_cmd(c); 3347 3349 } // repeat cnt 3348 3350 dc3: 3349 if (last_search_pattern == 0) { 3350 msg = "No previous regular expression"; 3351 goto dc2; 3352 } 3353 if (last_search_pattern[0] == '/') { 3354 dir = FORWARD; // assume FORWARD search 3355 p = dot + 1; 3356 } 3351 dir = FORWARD; // assume FORWARD search 3352 p = dot + 1; 3357 3353 if (last_search_pattern[0] == '?') { 3358 3354 dir = BACK; 3359 3355 p = dot - 1; -
findutils/grep.c
diff -Naur busybox-1.12.1.orig/findutils/grep.c busybox-1.12.1/findutils/grep.c
old new 363 363 * (unless -v: -Fov doesnt print anything at all) */ 364 364 if (found) 365 365 print_line(gl->pattern, strlen(gl->pattern), linenum, ':'); 366 } else { 366 } else while (1) { 367 char old = line[gl->matched_range.rm_eo]; 367 368 line[gl->matched_range.rm_eo] = '\0'; 368 369 print_line(line + gl->matched_range.rm_so, 369 370 gl->matched_range.rm_eo - gl->matched_range.rm_so, 370 371 linenum, ':'); 371 } 372 line[gl->matched_range.rm_eo] = old; 373 #if !ENABLE_EXTRA_COMPAT 374 break; 375 #else 376 if (re_search(&gl->compiled_regex, line, line_len, 377 gl->matched_range.rm_eo, line_len - gl->matched_range.rm_eo, 378 &gl->matched_range) < 0) 379 break; 380 #endif 381 } 372 382 } else { 373 383 print_line(line, line_len, linenum, ':'); 374 384 } -
include/applets.h
diff -Naur busybox-1.12.1.orig/include/applets.h busybox-1.12.1/include/applets.h
old new 136 136 USE_ED(APPLET(ed, _BB_DIR_BIN, _BB_SUID_NEVER)) 137 137 USE_FEATURE_GREP_EGREP_ALIAS(APPLET_ODDNAME(egrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER, egrep)) 138 138 USE_EJECT(APPLET(eject, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 139 USE_ENV(APPLET (env, _BB_DIR_USR_BIN, _BB_SUID_NEVER))139 USE_ENV(APPLET_NOEXEC(env, env, _BB_DIR_USR_BIN, _BB_SUID_NEVER, env)) 140 140 USE_ENVDIR(APPLET_ODDNAME(envdir, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envdir)) 141 141 USE_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER, envuidgid)) 142 142 USE_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, _BB_DIR_USR_BIN, _BB_SUID_NEVER, ether_wake)) … … 171 171 USE_GUNZIP(APPLET(gunzip, _BB_DIR_BIN, _BB_SUID_NEVER)) 172 172 USE_GZIP(APPLET(gzip, _BB_DIR_BIN, _BB_SUID_NEVER)) 173 173 USE_HALT(APPLET(halt, _BB_DIR_SBIN, _BB_SUID_NEVER)) 174 USE_HD(APPLET_ ODDNAME(hd, hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER, hd))174 USE_HD(APPLET_NOEXEC(hd, hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER, hd)) 175 175 USE_HDPARM(APPLET(hdparm, _BB_DIR_SBIN, _BB_SUID_NEVER)) 176 176 USE_HEAD(APPLET(head, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 177 177 USE_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, _BB_DIR_USR_BIN, _BB_SUID_NEVER, hexdump)) -
libbb/getopt32.c
diff -Naur busybox-1.12.1.orig/libbb/getopt32.c busybox-1.12.1/libbb/getopt32.c
old new 515 515 } 516 516 } 517 517 518 /* In case getopt32 was already called:519 * reset the libc getopt() function, which keeps internal state.520 *521 * BSD-derived getopt() functions require that optind be set to 1 in522 * order to reset getopt() state. This used to be generally accepted523 * way of resetting getopt(). However, glibc's getopt()524 * has additional getopt() state beyond optind, and requires that525 * optind be set to zero to reset its state. So the unfortunate state of526 * affairs is that BSD-derived versions of getopt() misbehave if527 * optind is set to 0 in order to reset getopt(), and glibc's getopt()528 * will core dump if optind is set 1 in order to reset getopt().529 *530 * More modern versions of BSD require that optreset be set to 1 in531 * order to reset getopt(). Sigh. Standards, anyone?532 */533 #ifdef __GLIBC__534 optind = 0;535 #else /* BSD style */536 optind = 1;537 /* optreset = 1; */538 #endif539 /* optarg = NULL; opterr = 0; optopt = 0; - do we need this?? */540 518 pargv = NULL; 541 519 542 520 /* Note: just "getopt() <= 0" will not work well for -
libbb/lineedit.c
diff -Naur busybox-1.12.1.orig/libbb/lineedit.c busybox-1.12.1/libbb/lineedit.c
old new 1415 1415 if ((state->flags & SAVE_HISTORY) && state->hist_file) 1416 1416 load_history(state->hist_file); 1417 1417 #endif 1418 state->cur_history = state->cnt_history; 1418 if (state->flags & DO_HISTORY) 1419 state->cur_history = state->cnt_history; 1419 1420 1420 1421 /* prepare before init handlers */ 1421 1422 cmdedit_y = 0; /* quasireal y, not true if line > xt*yt */ -
libbb/setup_environment.c
diff -Naur busybox-1.12.1.orig/libbb/setup_environment.c busybox-1.12.1/libbb/setup_environment.c
old new 32 32 33 33 void FAST_FUNC setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw) 34 34 { 35 /* Change the current working directory to be the home directory 36 * of the user */ 37 if (chdir(pw->pw_dir)) { 38 xchdir("/"); 39 bb_error_msg("can't chdir to home directory '%s'", pw->pw_dir); 40 } 41 35 42 if (clear_env) { 36 43 const char *term; 37 44 38 /* Change the current working directory to be the home directory39 * of the user */40 if (chdir(pw->pw_dir)) {41 xchdir("/");42 bb_error_msg("can't chdir to home directory '%s'", pw->pw_dir);43 }44 45 45 /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH. 46 46 Unset all other environment variables. */ 47 47 term = getenv("TERM"); -
libbb/vfork_daemon_rexec.c
diff -Naur busybox-1.12.1.orig/libbb/vfork_daemon_rexec.c busybox-1.12.1/libbb/vfork_daemon_rexec.c
old new 125 125 int rc, argc; 126 126 127 127 applet_name = APPLET_NAME(applet_no); 128 128 129 xfunc_error_retval = EXIT_FAILURE; 129 130 130 131 /* Special flag for xfunc_die(). If xfunc will "die" … … 132 133 * die_sleep and longjmp here instead. */ 133 134 die_sleep = -1; 134 135 135 /* option_mask32 = 0; - not needed */ 136 /* In case getopt() or getopt32() was already called: 137 * reset the libc getopt() function, which keeps internal state. 138 * 139 * BSD-derived getopt() functions require that optind be set to 1 in 140 * order to reset getopt() state. This used to be generally accepted 141 * way of resetting getopt(). However, glibc's getopt() 142 * has additional getopt() state beyond optind, and requires that 143 * optind be set to zero to reset its state. So the unfortunate state of 144 * affairs is that BSD-derived versions of getopt() misbehave if 145 * optind is set to 0 in order to reset getopt(), and glibc's getopt() 146 * will core dump if optind is set 1 in order to reset getopt(). 147 * 148 * More modern versions of BSD require that optreset be set to 1 in 149 * order to reset getopt(). Sigh. Standards, anyone? 150 */ 151 #ifdef __GLIBC__ 152 optind = 0; 153 #else /* BSD style */ 154 optind = 1; 155 /* optreset = 1; */ 156 #endif 157 /* optarg = NULL; opterr = 1; optopt = 63; - do we need this too? */ 158 /* (values above are what they initialized to in glibc and uclibc) */ 159 /* option_mask32 = 0; - not needed, no applet depends on it being 0 */ 136 160 137 161 argc = 1; 138 162 while (argv[argc]) … … 161 185 rc = 0; 162 186 } 163 187 164 /* Restoring globals */188 /* Restoring some globals */ 165 189 restore_nofork_data(old); 190 191 /* Other globals can be simply reset to defaults */ 192 #ifdef __GLIBC__ 193 optind = 0; 194 #else /* BSD style */ 195 optind = 1; 196 #endif 197 166 198 return rc & 0xff; /* don't confuse people with "exitcodes" >255 */ 167 199 } 168 200 -
modutils/modprobe.c
diff -Naur busybox-1.12.1.orig/modutils/modprobe.c busybox-1.12.1/modutils/modprobe.c
old new 263 263 return TRUE; 264 264 } 265 265 266 static int include_conf_recursive(struct include_conf_t *conf, const char *filename )266 static int include_conf_recursive(struct include_conf_t *conf, const char *filename, int flags) 267 267 { 268 return recursive_action(filename, ACTION_RECURSE ,268 return recursive_action(filename, ACTION_RECURSE | flags, 269 269 include_conf_file_act, 270 270 include_conf_dir_act, 271 271 conf, 1); … … 362 362 char *includefile; 363 363 364 364 includefile = skip_whitespace(line_buffer + 8); 365 include_conf_recursive(conf, includefile );365 include_conf_recursive(conf, includefile, 0); 366 366 } else if (ENABLE_FEATURE_MODPROBE_BLACKLIST && 367 367 (is_conf_command(line_buffer, "blacklist"))) { 368 368 char *mod; … … 559 559 if (ENABLE_FEATURE_2_6_MODULES) { 560 560 if (include_conf_file(&conf, "/etc/modprobe.conf")) 561 561 r = TRUE; 562 if (include_conf_recursive(&conf, "/etc/modprobe.d" ))562 if (include_conf_recursive(&conf, "/etc/modprobe.d", ACTION_QUIET)) 563 563 r = TRUE; 564 564 } 565 565 if (ENABLE_FEATURE_2_4_MODULES && !r) -
busybox-1.12.1
diff -Naur busybox-1.12.1.orig/shell/ash.c busybox-1.12.1/shell/ash.c
old new 6964 6964 6965 6965 #if ENABLE_FEATURE_SH_STANDALONE 6966 6966 if (applet_no >= 0) { 6967 if (APPLET_IS_NOEXEC(applet_no)) 6967 if (APPLET_IS_NOEXEC(applet_no)) { 6968 while (*envp) 6969 putenv(*envp++); 6968 6970 run_applet_no_and_exit(applet_no, argv); 6971 } 6969 6972 /* re-exec ourselves with the new arguments */ 6970 6973 execve(bb_busybox_exec_path, argv, envp); 6971 6974 /* If they called chroot or otherwise made the binary no longer … … 12014 12017 char *name; 12015 12018 const char *p; 12016 12019 char **aptr; 12017 int flag = argv[0][0] == 'r' ? VREADONLY : VEXPORT;12020 int flag = argv[0][0] == 'r' ? VREADONLY : VEXPORT; 12018 12021 12019 12022 if (nextopt("p") != 'p') { 12020 12023 aptr = argptr; -
util-linux/getopt.c
diff -Naur busybox-1.12.1.orig/util-linux/getopt.c busybox-1.12.1/util-linux/getopt.c
old new 142 142 * Other settings are found in global variables. 143 143 */ 144 144 #if !ENABLE_GETOPT_LONG 145 #define generate_output(argv,argc,optstr,longopts) generate_output(argv,argc,optstr) 145 #define generate_output(argv,argc,optstr,longopts) \ 146 generate_output(argv,argc,optstr) 146 147 #endif 147 148 static int generate_output(char **argv, int argc, const char *optstr, const struct option *longopts) 148 149 { … … 156 157 if (quiet_errors) /* No error reporting from getopt(3) */ 157 158 opterr = 0; 158 159 159 /* Reset getopt(3) (see libbb/getopt32.c for long rant) */160 #ifdef __GLIBC__161 optind = 0;162 #else /* BSD style */163 optind = 1;164 /* optreset = 1; */165 #endif166 167 160 while (1) { 168 161 opt = 169 162 #if ENABLE_GETOPT_LONG
Note:
See TracBrowser
for help on using the repository browser.