source:
clfs-embedded/patches/busybox-1.13.2-branch_update-3.patch@
ff4ee7e
Last change on this file since ff4ee7e was 7791a76, checked in by , 16 years ago | |
---|---|
|
|
File size: 11.4 KB |
-
archival/tar.c
Submitted By: Jim Gifford (jim at cross-lfs dot org) Date: 02-16-2009 Initial Package Version: 1.13.2 Origin: Upstream Upstream Status: Applied Description: This is a branch update for busybox-1.13.2, and should be rechecked periodically. diff -Naur busybox-1.13.2.orig/archival/tar.c busybox-1.13.2/archival/tar.c
old new 591 591 struct TarBallInfo tbInfo; 592 592 593 593 tbInfo.hlInfoHead = NULL; 594 595 fchmod(tar_fd, 0644);596 594 tbInfo.tarFd = tar_fd; 597 595 tbInfo.verboseFlag = verboseFlag; 598 596 -
include/libbb.h
diff -Naur busybox-1.13.2.orig/include/libbb.h busybox-1.13.2/include/libbb.h
old new 1275 1275 PSSCAN_UTIME = 1 << 13, 1276 1276 PSSCAN_TTY = 1 << 14, 1277 1277 PSSCAN_SMAPS = (1 << 15) * ENABLE_FEATURE_TOPMEM, 1278 PSSCAN_ARGVN = (1 << 16) * (ENABLE_PGREP || ENABLE_PKILL || ENABLE_PIDOF), 1278 /* NB: used by find_pid_by_name(). Any applet using it 1279 * needs to be mentioned here. */ 1280 PSSCAN_ARGVN = (1 << 16) * (ENABLE_KILLALL 1281 || ENABLE_PGREP || ENABLE_PKILL 1282 || ENABLE_PIDOF 1283 || ENABLE_SESTATUS 1284 ), 1279 1285 USE_SELINUX(PSSCAN_CONTEXT = 1 << 17,) 1280 1286 PSSCAN_START_TIME = 1 << 18, 1281 1287 PSSCAN_CPU = 1 << 19, -
busybox-1.13.2
diff -Naur busybox-1.13.2.orig/init/init.c busybox-1.13.2/init/init.c
old new 671 671 */ 672 672 static void parse_inittab(void) 673 673 { 674 #if ENABLE_FEATURE_USE_INITTAB 674 675 char *token[4]; 675 /* order must correspond to SYSINIT..RESTART constants */ 676 static const char actions[] ALIGN1 = 677 "sysinit\0""respawn\0""askfirst\0""wait\0""once\0" 678 "ctrlaltdel\0""shutdown\0""restart\0"; 679 680 parser_t *parser = config_open2(INITTAB, fopen_for_read); 681 /* No inittab file -- set up some default behavior */ 682 if (parser == NULL) { 676 parser_t *parser = config_open2("/etc/inittab", fopen_for_read); 677 678 if (parser == NULL) 679 #endif 680 { 681 /* No inittab file -- set up some default behavior */ 683 682 /* Reboot on Ctrl-Alt-Del */ 684 683 new_init_action(CTRLALTDEL, "reboot", ""); 685 684 /* Umount all filesystems on halt/reboot */ … … 699 698 new_init_action(SYSINIT, INIT_SCRIPT, ""); 700 699 return; 701 700 } 701 702 #if ENABLE_FEATURE_USE_INITTAB 702 703 /* optional_tty:ignored_runlevel:action:command 703 704 * Delims are not to be collapsed and need exactly 4 tokens 704 705 */ 705 706 while (config_read(parser, token, 4, 0, "#:", 706 707 PARSE_NORMAL & ~(PARSE_TRIM | PARSE_COLLAPSE))) { 708 /* order must correspond to SYSINIT..RESTART constants */ 709 static const char actions[] ALIGN1 = 710 "sysinit\0""respawn\0""askfirst\0""wait\0""once\0" 711 "ctrlaltdel\0""shutdown\0""restart\0"; 707 712 int action; 708 713 char *tty = token[0]; 709 714 … … 727 732 parser->lineno); 728 733 } 729 734 config_close(parser); 735 #endif 730 736 } 731 737 732 738 #if ENABLE_FEATURE_USE_INITTAB -
modutils/depmod.c
diff -Naur busybox-1.13.2.orig/modutils/depmod.c busybox-1.13.2/modutils/depmod.c
old new 33 33 enum { 34 34 ARG_a = (1<<0), /* All modules, ignore mods in argv */ 35 35 ARG_A = (1<<1), /* Only emit .ko that are newer than modules.dep file */ 36 ARG_b = (1<<2), /* not /lib/modules/$(uname -r)/ but this base-dir*/36 ARG_b = (1<<2), /* base directory when modules are in staging area */ 37 37 ARG_e = (1<<3), /* with -F, print unresolved symbols */ 38 38 ARG_F = (1<<4), /* System.map that contains the symbols */ 39 39 ARG_n = (1<<5) /* dry-run, print to stdout only */ … … 57 57 *first = info; 58 58 59 59 info->dnext = info->dprev = info; 60 info->name = x strdup(fname);60 info->name = xasprintf("/%s", fname); 61 61 info->modname = filename2modname(fname, NULL); 62 62 for (ptr = image; ptr < image + len - 10; ptr++) { 63 63 if (strncmp(ptr, "depends=", 8) == 0) { … … 123 123 } 124 124 } 125 125 126 static void xfreopen_write(const char *file, FILE *f) 127 { 128 if (freopen(file, "w", f) == NULL) 129 bb_perror_msg_and_die("can't open '%s'", file); 130 } 131 126 132 int depmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 127 133 int depmod_main(int argc UNUSED_PARAM, char **argv) 128 134 { 129 135 module_info *modules = NULL, *m, *dep; 130 char *moddir_base = (char *)CONFIG_DEFAULT_MODULES_DIR; 136 const char *moddir_base = "/"; 137 char *moddir, *version; 138 struct utsname uts; 131 139 int tmp; 132 140 133 141 getopt32(argv, "aAb:eF:n", &moddir_base, NULL); 134 142 argv += optind; 135 143 136 144 /* goto modules location */ 145 xchdir(moddir_base); 137 146 138 147 /* If a version is provided, then that kernel version's module directory 139 148 * is used, rather than the current kernel version (as returned by 140 149 * "uname -r"). */ 141 xchdir(moddir_base); 142 if (*argv && (sscanf(*argv, "%d.%d.%d", &tmp, &tmp, &tmp) == 3)) { 143 xchdir(*argv++); 150 if (*argv && sscanf(*argv, "%d.%d.%d", &tmp, &tmp, &tmp) == 3) { 151 version = *argv++; 144 152 } else { 145 struct utsname uts;146 153 uname(&uts); 147 xchdir(uts.release);154 version = uts.release; 148 155 } 149 /* If no modules are given on the command-line, -a is on per default. */ 150 option_mask32 |= *argv == NULL; 156 moddir = concat_path_file(&CONFIG_DEFAULT_MODULES_DIR[1], version); 151 157 152 158 /* Scan modules */ 153 moddir_base = xrealloc_getcwd_or_warn(NULL); 154 do { 155 recursive_action((option_mask32 & ARG_a) ? moddir_base : *argv, 156 ACTION_RECURSE, parse_module, NULL, &modules, 0); 157 } while (!(option_mask32 & ARG_a) && *(++argv)); 159 if (*argv) { 160 char *modfile; 161 struct stat sb; 162 do { 163 modfile = concat_path_file(moddir, *argv); 164 xstat(modfile, &sb); 165 parse_module(modfile, &sb, &modules, 0); 166 free(modfile); 167 } while (*(++argv)); 168 } else { 169 recursive_action(moddir, ACTION_RECURSE, 170 parse_module, NULL, &modules, 0); 171 } 172 173 /* Prepare for writing out the dep files */ 174 xchdir(moddir); 158 175 if (ENABLE_FEATURE_CLEAN_UP) 159 free(moddir _base);176 free(moddir); 160 177 161 178 /* Generate dependency and alias files */ 162 179 if (!(option_mask32 & ARG_n)) 163 freopen(CONFIG_DEFAULT_DEPMOD_FILE, "w", stdout);180 xfreopen_write(CONFIG_DEFAULT_DEPMOD_FILE, stdout); 164 181 for (m = modules; m != NULL; m = m->next) { 165 182 printf("%s:", m->name); 166 183 … … 174 191 dep->dprev->dnext = dep->dnext; 175 192 dep->dnext = dep->dprev = dep; 176 193 } 177 puts("");194 bb_putchar('\n'); 178 195 } 179 196 180 197 #if ENABLE_FEATURE_MODUTILS_ALIAS 181 198 if (!(option_mask32 & ARG_n)) 182 freopen("modules.alias", "w", stdout);199 xfreopen_write("modules.alias", stdout); 183 200 for (m = modules; m != NULL; m = m->next) { 184 201 while (m->aliases) { 185 202 printf("alias %s %s\n", … … 190 207 #endif 191 208 #if ENABLE_FEATURE_MODUTILS_SYMBOLS 192 209 if (!(option_mask32 & ARG_n)) 193 freopen("modules.symbols", "w", stdout);210 xfreopen_write("modules.symbols", stdout); 194 211 for (m = modules; m != NULL; m = m->next) { 195 212 while (m->symbols) { 196 213 printf("alias symbol:%s %s\n", -
modutils/modutils-24.c
diff -Naur busybox-1.13.2.orig/modutils/modutils-24.c busybox-1.13.2/modutils/modutils-24.c
old new 2150 2150 sec->name = name; 2151 2151 sec->idx = newidx; 2152 2152 if (size) 2153 sec->contents = x malloc(size);2153 sec->contents = xzalloc(size); 2154 2154 2155 2155 obj_insert_section_load_order(f, sec); 2156 2156 … … 2165 2165 int newidx = f->header.e_shnum++; 2166 2166 struct obj_section *sec; 2167 2167 2168 f->sections = xrealloc (f->sections, (newidx + 1) * sizeof(sec));2168 f->sections = xrealloc_vector(f->sections, 2, newidx); 2169 2169 f->sections[newidx] = sec = arch_new_section(); 2170 2170 2171 2171 sec->header.sh_type = SHT_PROGBITS; … … 2175 2175 sec->name = name; 2176 2176 sec->idx = newidx; 2177 2177 if (size) 2178 sec->contents = x malloc(size);2178 sec->contents = xzalloc(size); 2179 2179 2180 2180 sec->load_next = f->load_order; 2181 2181 f->load_order = sec; … … 2571 2571 /* Collect the modules' symbols. */ 2572 2572 2573 2573 if (nmod) { 2574 ext_modules = modules = xmalloc(nmod * sizeof(*modules)); 2575 memset(modules, 0, nmod * sizeof(*modules)); 2574 ext_modules = modules = xzalloc(nmod * sizeof(*modules)); 2576 2575 for (i = 0, mn = module_names, m = modules; 2577 2576 i < nmod; ++i, ++m, mn += strlen(mn) + 1) { 2578 2577 struct new_module_info info; … … 2652 2651 } 2653 2652 2654 2653 2655 static void 2654 static void new_create_this_module(struct obj_file *f, const char *m_name) 2656 2655 { 2657 2656 struct obj_section *sec; 2658 2657 2659 2658 sec = obj_create_alloced_section_first(f, ".this", tgt_sizeof_long, 2660 2659 sizeof(struct new_module)); 2661 memset(sec->contents, 0, sizeof(struct new_module)); 2660 /* done by obj_create_alloced_section_first: */ 2661 /*memset(sec->contents, 0, sizeof(struct new_module));*/ 2662 2662 2663 2663 obj_add_symbol(f, SPFX "__this_module", -1, 2664 2664 ELF_ST_INFO(STB_LOCAL, STT_OBJECT), sec->idx, 0, … … 2965 2965 if (i == f->header.e_shnum) { 2966 2966 struct obj_section *sec; 2967 2967 2968 f->header.e_shnum++; 2968 2969 f->sections = xrealloc_vector(f->sections, 2, i); 2969 2970 f->sections[i] = sec = arch_new_section(); 2970 f->header.e_shnum = i + 1;2971 2971 2972 2972 sec->header.sh_type = SHT_PROGBITS; 2973 2973 sec->header.sh_flags = SHF_WRITE | SHF_ALLOC; … … 3006 3006 for (i = 0; i < f->header.e_shnum; ++i) { 3007 3007 struct obj_section *s = f->sections[i]; 3008 3008 if (s->header.sh_type == SHT_NOBITS) { 3009 s->contents = NULL; 3009 3010 if (s->header.sh_size != 0) 3010 s->contents = memset(xmalloc(s->header.sh_size), 3011 0, s->header.sh_size); 3012 else 3013 s->contents = NULL; 3014 3011 s->contents = xzalloc(s->header.sh_size); 3015 3012 s->header.sh_type = SHT_PROGBITS; 3016 3013 } 3017 3014 } … … 3275 3272 case SHT_SYMTAB: 3276 3273 case SHT_STRTAB: 3277 3274 case SHT_RELM: 3275 sec->contents = NULL; 3278 3276 if (sec->header.sh_size > 0) { 3279 sec->contents = x malloc(sec->header.sh_size);3277 sec->contents = xzalloc(sec->header.sh_size); 3280 3278 fseek(fp, sec->header.sh_offset, SEEK_SET); 3281 3279 if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) { 3282 3280 bb_perror_msg_and_die("error reading ELF section data"); 3283 3281 } 3284 } else {3285 sec->contents = NULL;3286 3282 } 3287 3283 break; 3288 3284 -
testsuite/mdev.tests
diff -Naur busybox-1.13.2.orig/testsuite/mdev.tests busybox-1.13.2/testsuite/mdev.tests
old new 111 111 112 112 # continuing to use directory structure from prev test 113 113 rm -rf mdev.testdir/dev/* 114 echo "sda 0:0 644 =block/ @echo @echo TEST" >mdev.testdir/etc/mdev.conf 115 testing "mdev move and command" \ 116 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; 117 ls -lnR mdev.testdir/dev | $FILTER_LS2" \ 118 "\ 119 @echo TEST 120 mdev.testdir/dev: 121 drwxr-xr-x 2 0 0 block 122 123 mdev.testdir/dev/block: 124 brw-r--r-- 1 0 0 sda 125 " \ 126 "" "" 127 128 # continuing to use directory structure from prev test 129 rm -rf mdev.testdir/dev/* 114 130 echo "@8,0 :1 644" >mdev.testdir/etc/mdev.conf 115 131 testing "mdev #maj,min and no explicit uid" \ 116 132 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; -
util-linux/mdev.c
diff -Naur busybox-1.13.2.orig/util-linux/mdev.c busybox-1.13.2/util-linux/mdev.c
old new 179 179 unsigned i, n; 180 180 #endif 181 181 char *a = val; 182 s = strchr(val, ' '); 183 val = (s && s[1]) ? s+1 : NULL; 182 s = strchrnul(val, ' '); 183 val = (s[0] && s[1]) ? s+1 : NULL; 184 s[0] = '\0'; 184 185 #if ENABLE_FEATURE_MDEV_RENAME_REGEXP 185 186 /* substitute %1..9 with off[1..9], if any */ 186 187 n = 0;
Note:
See TracBrowser
for help on using the repository browser.