Changeset 17726


Ignore:
Timestamp:
10/08/11 15:43:28 (20 months ago)
Author:
BrainSlayer
Message:

migrate latest patches to busybox

Location:
src/router/busybox
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • src/router/busybox/.config_laguna

    r17649 r17726  
    813813CONFIG_FEATURE_TFTP_PUT=y 
    814814CONFIG_FEATURE_TFTP_BLOCKSIZE=y 
    815 # CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set 
     815CONFIG_FEATURE_TFTP_PROGRESS_BAR=y 
    816816# CONFIG_TFTP_DEBUG is not set 
    817817CONFIG_TRACEROUTE=y 
  • src/router/busybox/applets/applet_tables.c

    r17628 r17726  
    8181        printf("#define NUM_APPLETS %u\n", NUM_APPLETS); 
    8282        if (NUM_APPLETS == 1) { 
     83                char *dash_to_underscore, *p; 
    8384                printf("#define SINGLE_APPLET_STR \"%s\"\n", applets[0].name); 
    84                 printf("#define SINGLE_APPLET_MAIN %s_main\n", applets[0].name); 
     85                /* Example: "ether-wake" -> "ether_wake" */ 
     86                p = dash_to_underscore = strdup(applets[0].name); 
     87                p--; 
     88                while (*++p) 
     89                        if (*p == '-') 
     90                                *p = '_'; 
     91                printf("#define SINGLE_APPLET_MAIN %s_main\n", dash_to_underscore); 
    8592        } 
    8693        printf("\n"); 
  • src/router/busybox/coreutils/tail.c

    r17628 r17726  
    204204 
    205205                if (ENABLE_FEATURE_FANCY_TAIL && fd < 0) 
    206                         continue; /* may happen with -E */ 
     206                        continue; /* may happen with -F */ 
    207207 
    208208                if (nfiles > header_threshhold) { 
     
    253253                seen = 1; 
    254254                newlines_seen = 0; 
    255                 while ((nread = tail_read(fd, buf, tailbufsize-taillen)) > 0) { 
     255                while ((nread = tail_read(fd, buf, tailbufsize - taillen)) > 0) { 
    256256                        if (G.from_top) { 
    257257                                int nwrite = nread; 
     
    260260                                        if (COUNT_BYTES) { 
    261261                                                nwrite -= (count - seen); 
    262                                                 seen = count; 
     262                                                seen += nread; 
    263263                                        } else { 
    264264                                                char *s = buf; 
  • src/router/busybox/include/platform.h

    r17628 r17726  
    434434#endif 
    435435 
    436 #if defined(ANDROID) 
     436#if defined(ANDROID) || defined(__ANDROID__) 
    437437# undef HAVE_DPRINTF 
    438438# undef HAVE_GETLINE 
  • src/router/busybox/loginutils/chpasswd.c

    r17628 r17726  
    3434int chpasswd_main(int argc UNUSED_PARAM, char **argv) 
    3535{ 
    36         char *name, *pass; 
    37         char salt[sizeof("$N$XXXXXXXX")]; 
    38         int opt, rc; 
     36        char *name; 
     37        int opt; 
    3938 
    4039        if (getuid() != 0) 
     
    4645 
    4746        while ((name = xmalloc_fgetline(stdin)) != NULL) { 
     47                char *free_me; 
     48                char *pass; 
     49                int rc; 
     50 
    4851                pass = strchr(name, ':'); 
    4952                if (!pass) 
     
    5356                xuname2uid(name); /* dies if there is no such user */ 
    5457 
     58                free_me = NULL; 
    5559                if (!(opt & OPT_ENC)) { 
     60                        char salt[sizeof("$N$XXXXXXXX")]; 
     61 
    5662                        crypt_make_salt(salt, 1); 
    5763                        if (opt & OPT_MD5) { 
     
    6167                                crypt_make_salt(salt + 3, 4); 
    6268                        } 
    63                         pass = pw_encrypt(pass, salt, 0); 
     69                        free_me = pass = pw_encrypt(pass, salt, 0); 
    6470                } 
    6571 
     
    8288                logmode = LOGMODE_STDIO; 
    8389                free(name); 
    84                 if (!(opt & OPT_ENC)) 
    85                         free(pass); 
     90                free(free_me); 
    8691        } 
    8792        return EXIT_SUCCESS; 
  • src/router/busybox/miscutils/crond.c

    r17628 r17726  
    862862        /* "-b after -f is ignored", and so on for every pair a-b */ 
    863863        opt_complementary = "f-b:b-f:S-L:L-S" IF_FEATURE_CROND_D(":d-l") 
    864                         ":l+:d+"; /* -l and -d have numeric param */ 
     864                        /* -l and -d have numeric param */ 
     865                        ":l+" IF_FEATURE_CROND_D(":d+"); 
    865866        opts = getopt32(argv, "l:L:fbSc:" IF_FEATURE_CROND_D("d:"), 
    866867                        &G.log_level, &G.log_filename, &G.crontab_dir_name 
  • src/router/busybox/networking/inetd.c

    r17628 r17726  
    12791279                                                        rearm_alarm(); /* will revive it in RETRYTIME sec */ 
    12801280                                                        restore_sigmask(&omask); 
     1281                                                        maybe_close(new_udp_fd); 
    12811282                                                        maybe_close(accepted_fd); 
    12821283                                                        continue; /* -> check next fd in fd set */ 
     
    12991300                                        sleep(1); 
    13001301                                        restore_sigmask(&omask); 
     1302                                        maybe_close(new_udp_fd); 
    13011303                                        maybe_close(accepted_fd); 
    13021304                                        continue; /* -> check next fd in fd set */ 
     
    13051307                                        pid--; /* -1: "we did fork and we are child" */ 
    13061308                        } 
    1307                         /* if pid == 0 here, we never forked */ 
     1309                        /* if pid == 0 here, we didn't fork */ 
    13081310 
    13091311                        if (pid > 0) { /* parent */ 
    13101312                                if (sep->se_wait) { 
    1311                                         /* tcp wait: we passed listening socket to child, 
     1313                                        /* wait: we passed socket to child, 
    13121314                                         * will wait for child to terminate */ 
    13131315                                        sep->se_wait = pid; 
     
    13461348                        /* "nowait" udp */ 
    13471349                        if (new_udp_fd >= 0) { 
    1348                                 len_and_sockaddr *lsa = xzalloc_lsa(sep->se_family); 
     1350                                len_and_sockaddr *lsa; 
     1351                                int r; 
     1352 
     1353                                close(new_udp_fd); 
     1354                                lsa = xzalloc_lsa(sep->se_family); 
    13491355                                /* peek at the packet and remember peer addr */ 
    1350                                 int r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT, 
     1356                                r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT, 
    13511357                                        &lsa->u.sa, &lsa->len); 
    13521358                                if (r < 0) 
  • src/router/busybox/networking/tftp.c

    r17628 r17726  
    814814        } 
    815815        mode = local_file + strlen(local_file) + 1; 
    816         if (mode >= block_buf + result || strcmp(mode, "octet") != 0) { 
     816        /* RFC 1350 says mode string is case independent */ 
     817        if (mode >= block_buf + result || strcasecmp(mode, "octet") != 0) { 
    817818                goto err; 
    818819        } 
  • src/router/busybox/sysklogd/syslogd.c

    r17628 r17726  
    279279 
    280280        parser = config_open2(file ? file : "/etc/syslog.conf", 
    281                                 file ? xfopen_for_read : fopen_or_warn_stdin); 
     281                                file ? xfopen_for_read : fopen_for_read); 
    282282        if (!parser) 
    283283                /* didn't find default /etc/syslog.conf */ 
     
    679679#if ENABLE_FEATURE_IPC_SYSLOG 
    680680                if ((option_mask32 & OPT_circularlog) && G.shbuf) { 
    681                         log_to_shmem(msg); 
     681                        log_to_shmem(G.printbuf); 
    682682                        return; 
    683683                } 
  • src/router/busybox/testsuite/tail.tests

    r17628 r17726  
    1515        "" "qw" 
    1616 
     17testing "tail: -c +N with largish N" \ 
     18        " 
     19        dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8200 | wc -c; 
     20        dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8208 | wc -c; 
     21        " \ 
     22        "8185\n8177\n" \ 
     23        "" "" 
     24 
    1725exit $FAILCOUNT 
Note: See TracChangeset for help on using the changeset viewer.