]> git.pld-linux.org Git - packages/busybox.git/commitdiff
- patches from upstream
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sat, 15 Oct 2011 18:16:52 +0000 (18:16 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    busybox-1.14.2-ls.patch -> 1.2
    busybox-1.19.2-android.patch -> 1.1
    busybox-1.19.2-buildsys.patch -> 1.1
    busybox-1.19.2-chpasswd.patch -> 1.1
    busybox-1.19.2-crond.patch -> 1.1
    busybox-1.19.2-inetd.patch -> 1.1
    busybox-1.19.2-syslogd.patch -> 1.1
    busybox-1.19.2-tail.patch -> 1.1
    busybox-1.19.2-tftp.patch -> 1.1

busybox-1.14.2-ls.patch [deleted file]
busybox-1.19.2-android.patch [new file with mode: 0644]
busybox-1.19.2-buildsys.patch [new file with mode: 0644]
busybox-1.19.2-chpasswd.patch [new file with mode: 0644]
busybox-1.19.2-crond.patch [new file with mode: 0644]
busybox-1.19.2-inetd.patch [new file with mode: 0644]
busybox-1.19.2-syslogd.patch [new file with mode: 0644]
busybox-1.19.2-tail.patch [new file with mode: 0644]
busybox-1.19.2-tftp.patch [new file with mode: 0644]

diff --git a/busybox-1.14.2-ls.patch b/busybox-1.14.2-ls.patch
deleted file mode 100644 (file)
index 64e0a94..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-diff -urpN busybox-1.14.2/coreutils/ls.c busybox-1.14.2-ls/coreutils/ls.c
---- busybox-1.14.2/coreutils/ls.c      2009-06-22 00:40:29.000000000 +0200
-+++ busybox-1.14.2-ls/coreutils/ls.c   2009-07-03 12:46:16.000000000 +0200
-@@ -144,8 +144,7 @@ static const char ls_options[] ALIGN1 =
-       USE_FEATURE_LS_FOLLOWLINKS("L")   /* 1, 24 */
-       USE_FEATURE_LS_RECURSIVE("R")     /* 1, 25 */
-       USE_FEATURE_HUMAN_READABLE("h")   /* 1, 26 */
--      USE_SELINUX("K") /* 1, 27 */
--      USE_SELINUX("Z") /* 1, 28 */
-+      USE_SELINUX("KZ") /* 2, 28 */
-       USE_FEATURE_AUTOWIDTH("T:w:") /* 2, 30 */
-       ;
- enum {
-@@ -162,6 +161,16 @@ enum {
-       OPT_Q = (1 << 10),
-       //OPT_A = (1 << 11),
-       //OPT_k = (1 << 12),
-+      OPTBIT_color = 13
-+              + 4 * ENABLE_FEATURE_LS_TIMESTAMPS
-+              + 4 * ENABLE_FEATURE_LS_SORTFILES
-+              + 2 * ENABLE_FEATURE_LS_FILETYPES
-+              + 1 * ENABLE_FEATURE_LS_FOLLOWLINKS
-+              + 1 * ENABLE_FEATURE_LS_RECURSIVE
-+              + 1 * ENABLE_FEATURE_HUMAN_READABLE
-+              + 2 * ENABLE_SELINUX
-+              + 2 * ENABLE_FEATURE_AUTOWIDTH,
-+      OPT_color = 1 << OPTBIT_color,
- };
- enum {
-@@ -889,16 +898,6 @@ static int list_single(const struct dnod
- }
--/* colored LS support by JaWi, janwillem.janssen@lxtreme.nl */
--#if ENABLE_FEATURE_LS_COLOR
--/* long option entry used only for --color, which has no short option
-- * equivalent */
--static const char ls_color_opt[] ALIGN1 =
--      "color\0" Optional_argument "\xff" /* no short equivalent */
--      ;
--#endif
--
--
- int ls_main(int argc UNUSED_PARAM, char **argv)
- {
-       struct dnode **dnd;
-@@ -911,8 +910,25 @@ int ls_main(int argc UNUSED_PARAM, char 
-       int dnfiles;
-       int dndirs;
-       int i;
-+#if ENABLE_FEATURE_LS_COLOR
-+      /* colored LS support by JaWi, janwillem.janssen@lxtreme.nl */
-+      /* coreutils 6.10:
-+       * # ls --color=BOGUS
-+       * ls: invalid argument 'BOGUS' for '--color'
-+       * Valid arguments are:
-+       * 'always', 'yes', 'force'
-+       * 'never', 'no', 'none'
-+       * 'auto', 'tty', 'if-tty'
-+       * (and substrings: "--color=alwa" work too)
-+       */
-+      static const char ls_longopts[] ALIGN1 =
-+              "color\0" Optional_argument "\xff"; /* no short equivalent */
-+      static const char color_str[] ALIGN1 =
-+              "always\0""yes\0""force\0"
-+              "auto\0""tty\0""if-tty\0";
-       /* need to initialize since --color has _an optional_ argument */
--      USE_FEATURE_LS_COLOR(const char *color_opt = "always";)
-+      const char *color_opt = color_str; /* "always" */
-+#endif
-       INIT_G();
-@@ -927,7 +943,7 @@ int ls_main(int argc UNUSED_PARAM, char 
- #endif
-       /* process options */
--      USE_FEATURE_LS_COLOR(applet_long_options = ls_color_opt;)
-+      USE_FEATURE_LS_COLOR(applet_long_options = ls_longopts;)
- #if ENABLE_FEATURE_AUTOWIDTH
-       opt_complementary = "T+:w+"; /* -T N, -w N */
-       opt = getopt32(argv, ls_options, &tabstops, &terminal_width
-@@ -966,13 +982,20 @@ int ls_main(int argc UNUSED_PARAM, char 
-               if (!p || (p[0] && strcmp(p, "none") != 0))
-                       show_color = 1;
-       }
--      if (opt & (1 << i)) {  /* next flag after short options */
--              if (strcmp("always", color_opt) == 0)
--                      show_color = 1;
--              else if (strcmp("never", color_opt) == 0)
-+      if (opt & OPT_color) {
-+              if (color_opt[0] == 'n')
-                       show_color = 0;
--              else if (strcmp("auto", color_opt) == 0 && isatty(STDOUT_FILENO))
--                      show_color = 1;
-+              else switch (index_in_substrings(color_str, color_opt)) {
-+              case 3:
-+              case 4:
-+              case 5:
-+                      if (isatty(STDOUT_FILENO)) {
-+              case 0:
-+              case 1:
-+              case 2:
-+                              show_color = 1;
-+                      }
-+              }
-       }
- #endif
-diff -urpN busybox-1.14.2/testsuite/ls/ls-1-works busybox-1.14.2-ls/testsuite/ls/ls-1-works
---- busybox-1.14.2/testsuite/ls/ls-1-works     2009-06-22 00:32:00.000000000 +0200
-+++ busybox-1.14.2-ls/testsuite/ls/ls-1-works  2009-07-02 14:28:45.000000000 +0200
-@@ -1,4 +1,4 @@
- [ -n "$d" ] || d=..
--ls -1 "$d" > logfile.gnu
--busybox ls -1 "$d" > logfile.bb
--cmp logfile.gnu logfile.bb
-+LC_ALL=C ls -1 "$d" > logfile.gnu
-+LC_ALL=C busybox ls -1 "$d" > logfile.bb
-+diff -ubw logfile.gnu logfile.bb
-diff -urpN busybox-1.14.2/testsuite/ls/ls-h-works busybox-1.14.2-ls/testsuite/ls/ls-h-works
---- busybox-1.14.2/testsuite/ls/ls-h-works     2009-06-22 00:32:00.000000000 +0200
-+++ busybox-1.14.2-ls/testsuite/ls/ls-h-works  2009-07-02 14:28:45.000000000 +0200
-@@ -1,4 +1,4 @@
- [ -n "$d" ] || d=..
--ls -h "$d" > logfile.gnu
--busybox ls -h "$d" > logfile.bb
--cmp logfile.gnu logfile.bb
-+LC_ALL=C ls -h "$d" > logfile.gnu
-+LC_ALL=C busybox ls -h "$d" > logfile.bb
-+diff -ubw logfile.gnu logfile.bb
-diff -urpN busybox-1.14.2/testsuite/ls/ls-l-works busybox-1.14.2-ls/testsuite/ls/ls-l-works
---- busybox-1.14.2/testsuite/ls/ls-l-works     2009-06-22 00:32:00.000000000 +0200
-+++ busybox-1.14.2-ls/testsuite/ls/ls-l-works  2009-07-02 14:28:45.000000000 +0200
-@@ -1,4 +1,4 @@
- [ -n "$d" ] || d=..
- LC_ALL=C ls -l "$d" > logfile.gnu
--busybox ls -l "$d" > logfile.bb
--diff -w logfile.gnu logfile.bb
-+LC_ALL=C busybox ls -l "$d" > logfile.bb
-+diff -ubw logfile.gnu logfile.bb
-diff -urpN busybox-1.14.2/testsuite/ls/ls-s-works busybox-1.14.2-ls/testsuite/ls/ls-s-works
---- busybox-1.14.2/testsuite/ls/ls-s-works     2009-06-22 00:32:00.000000000 +0200
-+++ busybox-1.14.2-ls/testsuite/ls/ls-s-works  2009-07-02 14:28:45.000000000 +0200
-@@ -1,4 +1,4 @@
- [ -n "$d" ] || d=..
- LC_ALL=C ls -1s "$d" > logfile.gnu
--busybox ls -1s "$d" > logfile.bb
--cmp logfile.gnu logfile.bb
-+LC_ALL=C busybox ls -1s "$d" > logfile.bb
-+diff -ubw logfile.gnu logfile.bb
diff --git a/busybox-1.19.2-android.patch b/busybox-1.19.2-android.patch
new file mode 100644 (file)
index 0000000..e2e6528
--- /dev/null
@@ -0,0 +1,11 @@
+--- busybox-1.19.2/include/platform.h
++++ busybox-1.19.2-android/include/platform.h
+@@ -433,7 +433,7 @@ typedef unsigned smalluint;
+ # undef HAVE_STPCPY
+ #endif
+-#if defined(ANDROID)
++#if defined(ANDROID) || defined(__ANDROID__)
+ # undef HAVE_DPRINTF
+ # undef HAVE_GETLINE
+ # undef HAVE_STPCPY
diff --git a/busybox-1.19.2-buildsys.patch b/busybox-1.19.2-buildsys.patch
new file mode 100644 (file)
index 0000000..8e0c4c3
--- /dev/null
@@ -0,0 +1,19 @@
+--- busybox-1.19.2/applets/applet_tables.c
++++ busybox-1.19.2-buildsys/applets/applet_tables.c
+@@ -80,8 +80,15 @@ int main(int argc, char **argv)
+       printf("#define NUM_APPLETS %u\n", NUM_APPLETS);
+       if (NUM_APPLETS == 1) {
++              char *dash_to_underscore, *p;
+               printf("#define SINGLE_APPLET_STR \"%s\"\n", applets[0].name);
+-              printf("#define SINGLE_APPLET_MAIN %s_main\n", applets[0].name);
++              /* Example: "ether-wake" -> "ether_wake" */
++              p = dash_to_underscore = strdup(applets[0].name);
++              p--;
++              while (*++p)
++                      if (*p == '-')
++                              *p = '_';
++              printf("#define SINGLE_APPLET_MAIN %s_main\n", dash_to_underscore);
+       }
+       printf("\n");
diff --git a/busybox-1.19.2-chpasswd.patch b/busybox-1.19.2-chpasswd.patch
new file mode 100644 (file)
index 0000000..0cba0e2
--- /dev/null
@@ -0,0 +1,55 @@
+--- busybox-1.19.2/loginutils/chpasswd.c
++++ busybox-1.19.2-chpasswd/loginutils/chpasswd.c
+@@ -33,9 +33,8 @@ static const char chpasswd_longopts[] AL
+ int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+ int chpasswd_main(int argc UNUSED_PARAM, char **argv)
+ {
+-      char *name, *pass;
+-      char salt[sizeof("$N$XXXXXXXX")];
+-      int opt, rc;
++      char *name;
++      int opt;
+       if (getuid() != 0)
+               bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
+@@ -45,6 +44,10 @@ int chpasswd_main(int argc UNUSED_PARAM,
+       opt = getopt32(argv, "em");
+       while ((name = xmalloc_fgetline(stdin)) != NULL) {
++              char *free_me;
++              char *pass;
++              int rc;
++
+               pass = strchr(name, ':');
+               if (!pass)
+                       bb_error_msg_and_die("missing new password");
+@@ -52,7 +55,10 @@ int chpasswd_main(int argc UNUSED_PARAM,
+               xuname2uid(name); /* dies if there is no such user */
++              free_me = NULL;
+               if (!(opt & OPT_ENC)) {
++                      char salt[sizeof("$N$XXXXXXXX")];
++
+                       crypt_make_salt(salt, 1);
+                       if (opt & OPT_MD5) {
+                               salt[0] = '$';
+@@ -60,7 +66,7 @@ int chpasswd_main(int argc UNUSED_PARAM,
+                               salt[2] = '$';
+                               crypt_make_salt(salt + 3, 4);
+                       }
+-                      pass = pw_encrypt(pass, salt, 0);
++                      free_me = pass = pw_encrypt(pass, salt, 0);
+               }
+               /* This is rather complex: if user is not found in /etc/shadow,
+@@ -81,8 +87,7 @@ int chpasswd_main(int argc UNUSED_PARAM,
+                       bb_info_msg("Password for '%s' changed", name);
+               logmode = LOGMODE_STDIO;
+               free(name);
+-              if (!(opt & OPT_ENC))
+-                      free(pass);
++              free(free_me);
+       }
+       return EXIT_SUCCESS;
+ }
diff --git a/busybox-1.19.2-crond.patch b/busybox-1.19.2-crond.patch
new file mode 100644 (file)
index 0000000..043a846
--- /dev/null
@@ -0,0 +1,12 @@
+--- busybox-1.19.2/miscutils/crond.c
++++ busybox-1.19.2-crond/miscutils/crond.c
+@@ -861,7 +861,8 @@ int crond_main(int argc UNUSED_PARAM, ch
+       /* "-b after -f is ignored", and so on for every pair a-b */
+       opt_complementary = "f-b:b-f:S-L:L-S" IF_FEATURE_CROND_D(":d-l")
+-                      ":l+:d+"; /* -l and -d have numeric param */
++                      /* -l and -d have numeric param */
++                      ":l+" IF_FEATURE_CROND_D(":d+");
+       opts = getopt32(argv, "l:L:fbSc:" IF_FEATURE_CROND_D("d:"),
+                       &G.log_level, &G.log_filename, &G.crontab_dir_name
+                       IF_FEATURE_CROND_D(,&G.log_level));
diff --git a/busybox-1.19.2-inetd.patch b/busybox-1.19.2-inetd.patch
new file mode 100644 (file)
index 0000000..e1395a6
--- /dev/null
@@ -0,0 +1,47 @@
+--- busybox-1.19.2/networking/inetd.c
++++ busybox-1.19.2-inetd/networking/inetd.c
+@@ -1278,6 +1278,7 @@ int inetd_main(int argc UNUSED_PARAM, ch
+                                                       sep->se_count = 0;
+                                                       rearm_alarm(); /* will revive it in RETRYTIME sec */
+                                                       restore_sigmask(&omask);
++                                                      maybe_close(new_udp_fd);
+                                                       maybe_close(accepted_fd);
+                                                       continue; /* -> check next fd in fd set */
+                                               }
+@@ -1298,17 +1299,18 @@ int inetd_main(int argc UNUSED_PARAM, ch
+                                       bb_perror_msg("vfork"+1);
+                                       sleep(1);
+                                       restore_sigmask(&omask);
++                                      maybe_close(new_udp_fd);
+                                       maybe_close(accepted_fd);
+                                       continue; /* -> check next fd in fd set */
+                               }
+                               if (pid == 0)
+                                       pid--; /* -1: "we did fork and we are child" */
+                       }
+-                      /* if pid == 0 here, we never forked */
++                      /* if pid == 0 here, we didn't fork */
+                       if (pid > 0) { /* parent */
+                               if (sep->se_wait) {
+-                                      /* tcp wait: we passed listening socket to child,
++                                      /* wait: we passed socket to child,
+                                        * will wait for child to terminate */
+                                       sep->se_wait = pid;
+                                       remove_fd_from_set(sep->se_fd);
+@@ -1345,9 +1347,13 @@ int inetd_main(int argc UNUSED_PARAM, ch
+                       setsid();
+                       /* "nowait" udp */
+                       if (new_udp_fd >= 0) {
+-                              len_and_sockaddr *lsa = xzalloc_lsa(sep->se_family);
++                              len_and_sockaddr *lsa;
++                              int r;
++
++                              close(new_udp_fd);
++                              lsa = xzalloc_lsa(sep->se_family);
+                               /* peek at the packet and remember peer addr */
+-                              int r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT,
++                              r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT,
+                                       &lsa->u.sa, &lsa->len);
+                               if (r < 0)
+                                       goto do_exit1;
diff --git a/busybox-1.19.2-syslogd.patch b/busybox-1.19.2-syslogd.patch
new file mode 100644 (file)
index 0000000..d54f5d4
--- /dev/null
@@ -0,0 +1,20 @@
+--- busybox-1.19.2/sysklogd/syslogd.c
++++ busybox-1.19.2-syslogd/sysklogd/syslogd.c
+@@ -278,7 +278,7 @@ static void parse_syslogdcfg(const char 
+       parser_t *parser;
+       parser = config_open2(file ? file : "/etc/syslog.conf",
+-                              file ? xfopen_for_read : fopen_or_warn_stdin);
++                              file ? xfopen_for_read : fopen_for_read);
+       if (!parser)
+               /* didn't find default /etc/syslog.conf */
+               /* proceed as if we built busybox without config support */
+@@ -678,7 +678,7 @@ static void timestamp_and_log(int pri, c
+       if (LOG_PRI(pri) < G.logLevel) {
+ #if ENABLE_FEATURE_IPC_SYSLOG
+               if ((option_mask32 & OPT_circularlog) && G.shbuf) {
+-                      log_to_shmem(msg);
++                      log_to_shmem(G.printbuf);
+                       return;
+               }
+ #endif
diff --git a/busybox-1.19.2-tail.patch b/busybox-1.19.2-tail.patch
new file mode 100644 (file)
index 0000000..f3cc798
--- /dev/null
@@ -0,0 +1,43 @@
+--- busybox-1.19.2/coreutils/tail.c
++++ busybox-1.19.2-tail/coreutils/tail.c
+@@ -203,7 +203,7 @@ int tail_main(int argc, char **argv)
+               int fd = fds[i];
+               if (ENABLE_FEATURE_FANCY_TAIL && fd < 0)
+-                      continue; /* may happen with -E */
++                      continue; /* may happen with -F */
+               if (nfiles > header_threshhold) {
+                       tail_xprint_header(fmt, argv[i]);
+@@ -252,14 +252,14 @@ int tail_main(int argc, char **argv)
+                * Used only by +N code ("start from Nth", 1-based): */
+               seen = 1;
+               newlines_seen = 0;
+-              while ((nread = tail_read(fd, buf, tailbufsize-taillen)) > 0) {
++              while ((nread = tail_read(fd, buf, tailbufsize - taillen)) > 0) {
+                       if (G.from_top) {
+                               int nwrite = nread;
+                               if (seen < count) {
+                                       /* We need to skip a few more bytes/lines */
+                                       if (COUNT_BYTES) {
+                                               nwrite -= (count - seen);
+-                                              seen = count;
++                                              seen += nread;
+                                       } else {
+                                               char *s = buf;
+                                               do {
+--- busybox-1.19.2/testsuite/tail.tests
++++ busybox-1.19.2-tail/testsuite/tail.tests
+@@ -14,4 +14,12 @@ testing "tail: +N with N > file length" 
+       "0\n" \
+       "" "qw"
++testing "tail: -c +N with largish N" \
++      "
++      dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8200 | wc -c;
++      dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8208 | wc -c;
++      " \
++      "8185\n8177\n" \
++      "" ""
++
+ exit $FAILCOUNT
diff --git a/busybox-1.19.2-tftp.patch b/busybox-1.19.2-tftp.patch
new file mode 100644 (file)
index 0000000..15dc9e1
--- /dev/null
@@ -0,0 +1,12 @@
+--- busybox-1.19.2/networking/tftp.c
++++ busybox-1.19.2-tftp/networking/tftp.c
+@@ -813,7 +813,8 @@ int tftpd_main(int argc UNUSED_PARAM, ch
+               goto err;
+       }
+       mode = local_file + strlen(local_file) + 1;
+-      if (mode >= block_buf + result || strcmp(mode, "octet") != 0) {
++      /* RFC 1350 says mode string is case independent */
++      if (mode >= block_buf + result || strcasecmp(mode, "octet") != 0) {
+               goto err;
+       }
+ # if ENABLE_FEATURE_TFTP_BLOCKSIZE
This page took 0.167711 seconds and 4 git commands to generate.