From 528728488025df01388ab8e84bccfa62fbaf88e9 Mon Sep 17 00:00:00 2001 From: nico Date: Sun, 15 Aug 2010 20:28:05 +0000 Subject: package/busybox: add missing bits from 1.17.1 update (mostly config stuff), rename upstream patches so they're applied first git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22665 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/busybox/patches/000-autoconf.patch | 11 +++ package/busybox/patches/000-upstream-mktemp.patch | 11 +++ package/busybox/patches/000-upstream-sed.patch | 64 ++++++++++++++ package/busybox/patches/000-upstream-shell.patch | 98 ++++++++++++++++++++++ .../patches/241-udhcpc-oversized_packets.patch | 40 +++++---- package/busybox/patches/250-ash_export-n.patch | 4 +- package/busybox/patches/300-netmsg.patch | 31 ++++--- package/busybox/patches/310-passwd_access.patch | 2 +- package/busybox/patches/340-lock_util.patch | 2 +- package/busybox/patches/350-httpd_redir.patch | 19 ++--- package/busybox/patches/470-insmod_search.patch | 2 +- package/busybox/patches/510-awk_include.patch | 19 +++-- .../610-syslog-remote-retry-connection.patch | 28 +++---- package/busybox/patches/803-id_getgrouplist.patch | 4 +- package/busybox/patches/920-mktemp.patch | 11 --- package/busybox/patches/921-sed.patch | 64 -------------- package/busybox/patches/922-shell.patch | 98 ---------------------- 17 files changed, 265 insertions(+), 243 deletions(-) create mode 100644 package/busybox/patches/000-autoconf.patch create mode 100644 package/busybox/patches/000-upstream-mktemp.patch create mode 100644 package/busybox/patches/000-upstream-sed.patch create mode 100644 package/busybox/patches/000-upstream-shell.patch delete mode 100644 package/busybox/patches/920-mktemp.patch delete mode 100644 package/busybox/patches/921-sed.patch delete mode 100644 package/busybox/patches/922-shell.patch (limited to 'package/busybox/patches') diff --git a/package/busybox/patches/000-autoconf.patch b/package/busybox/patches/000-autoconf.patch new file mode 100644 index 000000000..d23745734 --- /dev/null +++ b/package/busybox/patches/000-autoconf.patch @@ -0,0 +1,11 @@ +--- a/applets/Kbuild.src ++++ b/applets/Kbuild.src +@@ -28,7 +28,7 @@ HOSTCFLAGS_usage_pod.o = -I$(srctree_sla + applets/applets.o: include/usage_compressed.h include/applet_tables.h + + applets/applet_tables: .config include/applets.h +-applets/usage: .config include/applets.h ++applets/usage: .config include/applets.h include/autoconf.h + applets/usage_pod: .config include/applet_tables.h include/applets.h + + quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h diff --git a/package/busybox/patches/000-upstream-mktemp.patch b/package/busybox/patches/000-upstream-mktemp.patch new file mode 100644 index 000000000..a7727ca81 --- /dev/null +++ b/package/busybox/patches/000-upstream-mktemp.patch @@ -0,0 +1,11 @@ +--- a/debianutils/mktemp.c ++++ b/debianutils/mktemp.c +@@ -50,7 +50,7 @@ int mktemp_main(int argc UNUSED_PARAM, c + opts = getopt32(argv, "dqtp:", &path); + + chp = argv[optind] ? argv[optind] : xstrdup("tmp.XXXXXX"); +- if (chp[0] != '/' || (opts & 8)) ++ if (!strchr(chp, '/') || (opts & 8)) + chp = concat_path_file(path, chp); + + if (opts & 1) { /* -d */ diff --git a/package/busybox/patches/000-upstream-sed.patch b/package/busybox/patches/000-upstream-sed.patch new file mode 100644 index 000000000..7693d626f --- /dev/null +++ b/package/busybox/patches/000-upstream-sed.patch @@ -0,0 +1,64 @@ +--- a/editors/sed.c ++++ b/editors/sed.c +@@ -61,6 +61,10 @@ + #include "libbb.h" + #include "xregex.h" + ++enum { ++ OPT_in_place = 1 << 0, ++}; ++ + /* Each sed command turns into one of these structures. */ + typedef struct sed_cmd_s { + /* Ordered by alignment requirements: currently 36 bytes on x86 */ +@@ -938,8 +942,11 @@ static void process_files(void) + + if (matched) { + /* once matched, "n,xxx" range is dead, disabling it */ +- if (sed_cmd->beg_line > 0) ++ if (sed_cmd->beg_line > 0 ++ && !(option_mask32 & OPT_in_place) /* but not for -i */ ++ ) { + sed_cmd->beg_line = -2; ++ } + sed_cmd->in_match = !( + /* has the ending line come, or is this a single address command? */ + (sed_cmd->end_line ? +@@ -1270,9 +1277,6 @@ static void add_cmd_block(char *cmdstr) + int sed_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; + int sed_main(int argc UNUSED_PARAM, char **argv) + { +- enum { +- OPT_in_place = 1 << 0, +- }; + unsigned opt; + llist_t *opt_e, *opt_f; + int status = EXIT_SUCCESS; +@@ -1292,6 +1296,7 @@ int sed_main(int argc UNUSED_PARAM, char + opt_e = opt_f = NULL; + opt_complementary = "e::f::" /* can occur multiple times */ + "nn"; /* count -n */ ++ /* -i must be first, to match OPT_in_place definition */ + opt = getopt32(argv, "irne:f:", &opt_e, &opt_f, + &G.be_quiet); /* counter for -n */ + //argc -= optind; +--- a/testsuite/sed.tests ++++ b/testsuite/sed.tests +@@ -270,11 +270,16 @@ testing "sed a cmd ended by double backs + | two \\ + ' + +-# fisrt three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges ++# first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges + testing "sed with N skipping lines past ranges on next cmds" \ + "sed -n '1{N;N;d};1p;2,3p;3p;4p'" \ + "4\n4\n" "" "1\n2\n3\n4\n" + ++testing "sed -i with address modifies all files, not only first" \ ++ "cp input input2; sed -i -e '1s/foo/bar/' input input2 && cat input input2; rm input2" \ ++ "bar\nbar\n" "foo\n" "" ++ ++ + # testing "description" "arguments" "result" "infile" "stdin" + + exit $FAILCOUNT diff --git a/package/busybox/patches/000-upstream-shell.patch b/package/busybox/patches/000-upstream-shell.patch new file mode 100644 index 000000000..4f0058e38 --- /dev/null +++ b/package/busybox/patches/000-upstream-shell.patch @@ -0,0 +1,98 @@ +--- a/shell/ash.c ++++ b/shell/ash.c +@@ -4515,6 +4515,7 @@ clear_traps(void) + INT_ON; + } + } ++ may_have_traps = 0; + } + + /* Lives far away from here, needed for forkchild */ +--- /dev/null ++++ b/shell/ash_test/ash-signals/signal7.right +@@ -0,0 +1 @@ ++Bug detected: 0 +--- /dev/null ++++ b/shell/ash_test/ash-signals/signal7.tests +@@ -0,0 +1,18 @@ ++bug() { ++ trap : exit ++ # Bug was causing sh to be run in subshell, ++ # as if this line is replaced with (sh -c ...; exit $?) & ++ # here: ++ sh -c 'echo REAL_CHILD=$$' & ++ echo PARENTS_IDEA_OF_CHILD=$! ++ wait # make sure bkgd shell completes ++} ++ ++bug | { ++while read varval; do ++ eval $varval ++done ++test x"$REAL_CHILD" != x"" \ ++&& test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD" ++echo "Bug detected: $?" ++} +--- a/shell/hush.c ++++ b/shell/hush.c +@@ -3901,8 +3901,6 @@ static void insert_bg_job(struct pipe *p + + if (G_interactive_fd) + printf("[%d] %d %s\n", job->jobid, job->cmds[0].pid, job->cmdtext); +- /* Last command's pid goes to $! */ +- G.last_bg_pid = job->cmds[job->num_cmds - 1].pid; + G.last_jobid = job->jobid; + } + +@@ -4825,6 +4823,8 @@ static int run_list(struct pipe *pi) + if (G.run_list_level == 1) + insert_bg_job(pi); + #endif ++ /* Last command's pid goes to $! */ ++ G.last_bg_pid = pi->cmds[pi->num_cmds - 1].pid; + G.last_exitcode = rcode = EXIT_SUCCESS; + debug_printf_exec(": cmd&: exitcode EXIT_SUCCESS\n"); + } else { +--- /dev/null ++++ b/shell/hush_test/hush-trap/signal7.right +@@ -0,0 +1 @@ ++Bug detected: 0 +--- /dev/null ++++ b/shell/hush_test/hush-trap/signal7.tests +@@ -0,0 +1,18 @@ ++bug() { ++ trap : exit ++ # Bug was causing sh to be run in subshell, ++ # as if this line is replaced with (sh -c ...; exit $?) & ++ # here: ++ sh -c 'echo REAL_CHILD=$$' & ++ echo PARENTS_IDEA_OF_CHILD=$! ++ wait # make sure bkgd shell completes ++} ++ ++bug | { ++while read varval; do ++ eval $varval ++done ++test x"$REAL_CHILD" != x"" \ ++&& test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD" ++echo "Bug detected: $?" ++} +--- a/shell/shell_common.c ++++ b/shell/shell_common.c +@@ -428,9 +428,14 @@ shell_builtin_ulimit(char **argv) + val <<= l->factor_shift; + } + //bb_error_msg("opt %c val_str:'%s' val:%lld", opt_char, val_str, (long long)val); ++ /* from man bash: "If neither -H nor -S ++ * is specified, both the soft and hard ++ * limits are set. */ ++ if (!opts) ++ opts = OPT_hard + OPT_soft; + if (opts & OPT_hard) + limit.rlim_max = val; +- if ((opts & OPT_soft) || opts == 0) ++ if (opts & OPT_soft) + limit.rlim_cur = val; + //bb_error_msg("setrlimit(%d, %lld, %lld)", l->cmd, (long long)limit.rlim_cur, (long long)limit.rlim_max); + if (setrlimit(l->cmd, &limit) < 0) { diff --git a/package/busybox/patches/241-udhcpc-oversized_packets.patch b/package/busybox/patches/241-udhcpc-oversized_packets.patch index b810752fc..ef9e7f4be 100644 --- a/package/busybox/patches/241-udhcpc-oversized_packets.patch +++ b/package/busybox/patches/241-udhcpc-oversized_packets.patch @@ -12,7 +12,7 @@ /* Construct a ip/udp header for a packet, send packet */ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt, uint32_t source_nip, int source_port, -@@ -173,11 +178,12 @@ int FAST_FUNC udhcp_send_raw_packet(stru +@@ -173,10 +178,10 @@ int FAST_FUNC udhcp_send_raw_packet(stru { struct sockaddr_ll dest_sll; struct ip_udp_dhcp_packet packet; @@ -20,27 +20,36 @@ int fd; int result = -1; const char *msg; - + int p_len = udhcp_get_payload_len(dhcp_pkt); -+ + fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)); if (fd < 0) { - msg = "socket(%s)"; -@@ -186,7 +192,7 @@ int FAST_FUNC udhcp_send_raw_packet(stru +@@ -185,8 +190,8 @@ int FAST_FUNC udhcp_send_raw_packet(stru + } memset(&dest_sll, 0, sizeof(dest_sll)); - memset(&packet, 0, offsetof(struct ip_udp_dhcp_packet, data)); +- memset(&packet, 0, offsetof(struct ip_udp_dhcp_packet, data)); - packet.data = *dhcp_pkt; /* struct copy */ ++ memset(&packet, 0, sizeof(packet)); + memcpy(&(packet.data), dhcp_pkt, p_len); dest_sll.sll_family = AF_PACKET; dest_sll.sll_protocol = htons(ETH_P_IP); -@@ -208,27 +214,25 @@ int FAST_FUNC udhcp_send_raw_packet(stru - * In order to work with those buggy servers, - * we truncate packets after end option byte. - */ -- padding = DHCP_OPTIONS_BUFSIZE - 1 - udhcp_end_option(packet.data.options); +@@ -199,36 +204,24 @@ int FAST_FUNC udhcp_send_raw_packet(stru + goto ret_close; + } +- /* We were sending full-sized DHCP packets (zero padded), +- * but some badly configured servers were seen dropping them. +- * Apparently they drop all DHCP packets >576 *ethernet* octets big, +- * whereas they may only drop packets >576 *IP* octets big +- * (which for typical Ethernet II means 590 octets: 6+6+2 + 576). +- * +- * In order to work with those buggy servers, +- * we truncate packets after end option byte. +- */ +- padding = DHCP_OPTIONS_BUFSIZE - 1 - udhcp_end_option(packet.data.options); +- packet.ip.protocol = IPPROTO_UDP; packet.ip.saddr = source_nip; packet.ip.daddr = dest_nip; @@ -65,11 +74,11 @@ udhcp_dump_packet(dhcp_pkt); - result = sendto(fd, &packet, IP_UPD_DHCP_SIZE - padding, /*flags:*/ 0, -+ result = sendto(fd, &packet, p_len, 0, ++ result = sendto(fd, &packet, p_len, /*flags:*/ 0, (struct sockaddr *) &dest_sll, sizeof(dest_sll)); msg = "sendto"; ret_close: -@@ -246,7 +250,6 @@ int FAST_FUNC udhcp_send_kernel_packet(s +@@ -246,7 +239,6 @@ int FAST_FUNC udhcp_send_kernel_packet(s uint32_t dest_nip, int dest_port) { struct sockaddr_in client; @@ -77,10 +86,11 @@ int fd; int result = -1; const char *msg; -@@ -278,8 +281,7 @@ int FAST_FUNC udhcp_send_kernel_packet(s +@@ -277,9 +269,7 @@ int FAST_FUNC udhcp_send_kernel_packet(s + } udhcp_dump_packet(dhcp_pkt); - +- - padding = DHCP_OPTIONS_BUFSIZE - 1 - udhcp_end_option(dhcp_pkt->options); - result = safe_write(fd, dhcp_pkt, DHCP_SIZE - padding); + result = safe_write(fd, dhcp_pkt, udhcp_get_payload_len(dhcp_pkt)); diff --git a/package/busybox/patches/250-ash_export-n.patch b/package/busybox/patches/250-ash_export-n.patch index 48efdcf94..9c23920b8 100644 --- a/package/busybox/patches/250-ash_export-n.patch +++ b/package/busybox/patches/250-ash_export-n.patch @@ -1,6 +1,6 @@ --- a/shell/ash.c +++ b/shell/ash.c -@@ -12428,8 +12428,17 @@ exportcmd(int argc UNUSED_PARAM, char ** +@@ -12429,8 +12429,17 @@ exportcmd(int argc UNUSED_PARAM, char ** const char *p; char **aptr; int flag = argv[0][0] == 'r' ? VREADONLY : VEXPORT; @@ -19,7 +19,7 @@ aptr = argptr; name = *aptr; if (name) { -@@ -12441,10 +12450,12 @@ exportcmd(int argc UNUSED_PARAM, char ** +@@ -12442,10 +12451,12 @@ exportcmd(int argc UNUSED_PARAM, char ** vp = *findvar(hashvar(name), name); if (vp) { vp->flags |= flag; diff --git a/package/busybox/patches/300-netmsg.patch b/package/busybox/patches/300-netmsg.patch index 7e48930bb..b7dd5d986 100644 --- a/package/busybox/patches/300-netmsg.patch +++ b/package/busybox/patches/300-netmsg.patch @@ -8,18 +8,6 @@ IF_NETSTAT(APPLET(netstat, _BB_DIR_BIN, _BB_SUID_DROP)) IF_NICE(APPLET(nice, _BB_DIR_BIN, _BB_SUID_DROP)) IF_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_DROP)) ---- a/include/usage.src.h -+++ b/include/usage.src.h -@@ -2961,6 +2961,9 @@ INSERT - " or\n" \ - "$ nameif -c /etc/my_mactab_file\n" \ - -+#define netmsg_trivial_usage NOUSAGE_STR -+#define netmsg_full_usage "" -+ - #define netstat_trivial_usage \ - "[-laentuwxr"IF_FEATURE_NETSTAT_WIDE("W")IF_FEATURE_NETSTAT_PRG("p")"]" - #define netstat_full_usage "\n\n" \ --- a/networking/Config.src +++ b/networking/Config.src @@ -623,6 +623,12 @@ config FEATURE_NAMEIF_EXTENDED @@ -30,7 +18,7 @@ + bool "netmsg" + default n + help -+ simple program for sending udp broadcast messages ++ simple program for sending udp broadcast messages + config NETSTAT bool "netstat" @@ -111,3 +99,20 @@ + close(s); + exit(1); +} +--- a/include/usage.src.h ++++ b/include/usage.src.h +@@ -1,3 +1,4 @@ ++ + /* vi: set sw=8 ts=8: */ + /* + * This file suffers from chronically incorrect tabification +@@ -2961,6 +2962,9 @@ INSERT + " or\n" \ + "$ nameif -c /etc/my_mactab_file\n" \ + ++#define netmsg_trivial_usage NOUSAGE_STR ++#define netmsg_full_usage "" ++ + #define netstat_trivial_usage \ + "[-laentuwxr"IF_FEATURE_NETSTAT_WIDE("W")IF_FEATURE_NETSTAT_PRG("p")"]" + #define netstat_full_usage "\n\n" \ diff --git a/package/busybox/patches/310-passwd_access.patch b/package/busybox/patches/310-passwd_access.patch index 24241c126..5faf6faf1 100644 --- a/package/busybox/patches/310-passwd_access.patch +++ b/package/busybox/patches/310-passwd_access.patch @@ -3,7 +3,7 @@ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -1717,21 +1717,32 @@ static int check_user_passwd(const char +@@ -1717,21 +1717,32 @@ static int check_user_passwd(const char if (ENABLE_FEATURE_HTTPD_AUTH_MD5) { char *md5_passwd; diff --git a/package/busybox/patches/340-lock_util.patch b/package/busybox/patches/340-lock_util.patch index b974b0446..473d1b9ac 100644 --- a/package/busybox/patches/340-lock_util.patch +++ b/package/busybox/patches/340-lock_util.patch @@ -10,7 +10,7 @@ IF_LOGNAME(APPLET_NOFORK(logname, logname, _BB_DIR_USR_BIN, _BB_SUID_DROP, logname)) --- a/include/usage.src.h +++ b/include/usage.src.h -@@ -2319,6 +2319,9 @@ INSERT +@@ -2320,6 +2320,9 @@ INSERT #define loadkmap_example_usage \ "$ loadkmap < /etc/i18n/lang-keymap\n" diff --git a/package/busybox/patches/350-httpd_redir.patch b/package/busybox/patches/350-httpd_redir.patch index 2bd569c29..7437d898c 100644 --- a/package/busybox/patches/350-httpd_redir.patch +++ b/package/busybox/patches/350-httpd_redir.patch @@ -1,6 +1,6 @@ --- a/include/usage.src.h +++ b/include/usage.src.h -@@ -1718,7 +1718,8 @@ INSERT +@@ -1719,7 +1719,8 @@ INSERT IF_FEATURE_HTTPD_SETUID(" [-u USER[:GRP]]") \ IF_FEATURE_HTTPD_BASIC_AUTH(" [-r REALM]") \ " [-h HOME]\n" \ @@ -10,16 +10,15 @@ #define httpd_full_usage "\n\n" \ "Listen for incoming HTTP requests\n" \ "\nOptions:" \ -@@ -2321,6 +2322,9 @@ INSERT +@@ -1737,6 +1738,8 @@ INSERT + "\n -m STRING MD5 crypt STRING") \ + "\n -e STRING HTML encode STRING" \ + "\n -d STRING URL decode STRING" \ ++ "\n -R PATH Redirect target path" \ ++ "\n -H HOST Redirect target host" \ - #define lock_trivial_usage NOUSAGE_STR - #define lock_full_usage "" -+ -+#define lock_trivial_usage NOUSAGE_STR -+#define lock_full_usage "" - - #define logger_trivial_usage \ - "[OPTIONS] [MESSAGE]" + #define hwclock_trivial_usage \ + IF_FEATURE_HWCLOCK_LONG_OPTIONS( \ --- a/networking/httpd.c +++ b/networking/httpd.c @@ -250,6 +250,8 @@ struct globals { diff --git a/package/busybox/patches/470-insmod_search.patch b/package/busybox/patches/470-insmod_search.patch index ef170a20c..8f52d985f 100644 --- a/package/busybox/patches/470-insmod_search.patch +++ b/package/busybox/patches/470-insmod_search.patch @@ -124,7 +124,7 @@ string "Default directory containing modules" default "/lib/modules" - depends on DEPMOD || MODPROBE || MODPROBE_SMALL || MODINFO -+ depends on DEPMOD || MODPROBE || MODPROBE_SMALL || MODINFO || INSMOD ++ depends on DEPMOD || INSMOD || MODPROBE || MODPROBE_SMALL || MODINFO help Directory that contains kernel modules. Defaults to "/lib/modules" diff --git a/package/busybox/patches/510-awk_include.patch b/package/busybox/patches/510-awk_include.patch index 36dd080f9..07f28c9de 100644 --- a/package/busybox/patches/510-awk_include.patch +++ b/package/busybox/patches/510-awk_include.patch @@ -1,6 +1,11 @@ --- a/editors/awk.c +++ b/editors/awk.c -@@ -70,9 +70,14 @@ typedef struct chain_s { +@@ -1,3 +1,4 @@ ++ + /* vi: set sw=4 ts=4: */ + /* + * awk implementation for busybox +@@ -70,9 +71,14 @@ typedef struct chain_s { } chain; /* Function */ @@ -15,7 +20,7 @@ } func; /* I/O stream */ -@@ -1453,7 +1458,8 @@ static void parse_program(char *p) +@@ -1453,7 +1459,8 @@ static void parse_program(char *p) next_token(TC_FUNCTION); g_pos++; f = newfunc(t_string); @@ -25,7 +30,7 @@ f->nargs = 0; while (next_token(TC_VARIABLE | TC_SEQTERM) & TC_VARIABLE) { v = findvar(ahash, t_string); -@@ -1462,7 +1468,7 @@ static void parse_program(char *p) +@@ -1462,7 +1469,7 @@ static void parse_program(char *p) if (next_token(TC_COMMA | TC_SEQTERM) & TC_SEQTERM) break; } @@ -34,7 +39,7 @@ chain_group(); clear_array(ahash); -@@ -2547,7 +2553,8 @@ static var *evaluate(node *op, var *res) +@@ -2547,7 +2554,8 @@ static var *evaluate(node *op, var *res) var *vbeg, *v; const char *sv_progname; @@ -44,7 +49,7 @@ syntax_error(EMSG_UNDEF_FUNC); vbeg = v = nvalloc(op->r.f->nargs + 1); -@@ -2564,7 +2571,10 @@ static var *evaluate(node *op, var *res) +@@ -2564,7 +2572,10 @@ static var *evaluate(node *op, var *res) fnargs = vbeg; sv_progname = g_progname; @@ -56,7 +61,7 @@ g_progname = sv_progname; nvfree(fnargs); -@@ -2942,6 +2952,143 @@ static rstream *next_input_file(void) +@@ -2942,6 +2953,143 @@ static rstream *next_input_file(void) #undef files_happen } @@ -200,7 +205,7 @@ int awk_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int awk_main(int argc, char **argv) { -@@ -3007,6 +3154,9 @@ int awk_main(int argc, char **argv) +@@ -3007,6 +3155,9 @@ int awk_main(int argc, char **argv) *s1 = '='; } } diff --git a/package/busybox/patches/610-syslog-remote-retry-connection.patch b/package/busybox/patches/610-syslog-remote-retry-connection.patch index 949ac9fd4..94cd3ded0 100644 --- a/package/busybox/patches/610-syslog-remote-retry-connection.patch +++ b/package/busybox/patches/610-syslog-remote-retry-connection.patch @@ -1,34 +1,26 @@ --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c -@@ -98,6 +98,8 @@ struct globals { - GLOBALS - - #if ENABLE_FEATURE_REMOTE_LOG -+ len_and_sockaddr *remoteAddr; -+ int remoteFD; - llist_t *remoteHosts; - #endif - #if ENABLE_FEATURE_IPC_SYSLOG -@@ -554,6 +556,7 @@ static void do_syslogd(void) NORETURN; - static void do_syslogd(void) +@@ -555,6 +555,7 @@ static void do_syslogd(void) { int sock_fd; -+ int send_err = 0; #if ENABLE_FEATURE_REMOTE_LOG ++ int send_err = 0; llist_t *item; #endif -@@ -637,10 +640,23 @@ static void do_syslogd(void) + #if ENABLE_FEATURE_SYSLOGD_DUP +@@ -636,11 +637,23 @@ static void do_syslogd(void) + if (rh->remoteFD == -1) continue; } - /* Send message to remote logger, ignore possible error */ +- /* Send message to remote logger, ignore possible error */ - /* TODO: on some errors, close and set G.remoteFD to -1 - * so that DNS resolution and connect is retried? */ - sendto(rh->remoteFD, recvbuf, sz+1, MSG_DONTWAIT, - &(rh->remoteAddr->u.sa), rh->remoteAddr->len); ++ /* Send message to remote logger */ + if (sendto(rh->remoteFD, recvbuf, sz+1, MSG_DONTWAIT, -+ &G.remoteAddr->u.sa, G.remoteAddr->len) == -1 ) { ++ &(rh->remoteAddr->u.sa), rh->remoteAddr->len) == -1) + send_err = errno; -+ } + + /* On some errors, close and set G.remoteFD to -1 + * so that DNS resolution and connect is retried */ @@ -38,8 +30,8 @@ + case EISCONN: + case ENOTCONN: + case EPIPE: -+ close(G.remoteFD); -+ G.remoteFD = -1; ++ close(rh->remoteFD); ++ rh->remoteFD = -1; + break; + } } diff --git a/package/busybox/patches/803-id_getgrouplist.patch b/package/busybox/patches/803-id_getgrouplist.patch index 48aa57c04..dd2dee66f 100644 --- a/package/busybox/patches/803-id_getgrouplist.patch +++ b/package/busybox/patches/803-id_getgrouplist.patch @@ -31,7 +31,7 @@ Signed-off-by: Nicolas Thill /* I guess *n < 0 might indicate error. Anyway, * malloc'ing -1 bytes won't be good, so: */ //if (*n < 0) -@@ -154,6 +160,7 @@ int id_main(int argc UNUSED_PARAM, char +@@ -154,6 +160,7 @@ int id_main(int argc UNUSED_PARAM, char if (egid != rgid) status |= print_group(egid, " "); } @@ -39,7 +39,7 @@ Signed-off-by: Nicolas Thill /* We are supplying largish buffer, trying * to not run get_groups() twice. That might be slow * ("user database in remote SQL server" case) */ -@@ -181,6 +188,7 @@ int id_main(int argc UNUSED_PARAM, char +@@ -181,6 +188,7 @@ int id_main(int argc UNUSED_PARAM, char } if (ENABLE_FEATURE_CLEAN_UP) free(groups); diff --git a/package/busybox/patches/920-mktemp.patch b/package/busybox/patches/920-mktemp.patch deleted file mode 100644 index a7727ca81..000000000 --- a/package/busybox/patches/920-mktemp.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/debianutils/mktemp.c -+++ b/debianutils/mktemp.c -@@ -50,7 +50,7 @@ int mktemp_main(int argc UNUSED_PARAM, c - opts = getopt32(argv, "dqtp:", &path); - - chp = argv[optind] ? argv[optind] : xstrdup("tmp.XXXXXX"); -- if (chp[0] != '/' || (opts & 8)) -+ if (!strchr(chp, '/') || (opts & 8)) - chp = concat_path_file(path, chp); - - if (opts & 1) { /* -d */ diff --git a/package/busybox/patches/921-sed.patch b/package/busybox/patches/921-sed.patch deleted file mode 100644 index 7693d626f..000000000 --- a/package/busybox/patches/921-sed.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- a/editors/sed.c -+++ b/editors/sed.c -@@ -61,6 +61,10 @@ - #include "libbb.h" - #include "xregex.h" - -+enum { -+ OPT_in_place = 1 << 0, -+}; -+ - /* Each sed command turns into one of these structures. */ - typedef struct sed_cmd_s { - /* Ordered by alignment requirements: currently 36 bytes on x86 */ -@@ -938,8 +942,11 @@ static void process_files(void) - - if (matched) { - /* once matched, "n,xxx" range is dead, disabling it */ -- if (sed_cmd->beg_line > 0) -+ if (sed_cmd->beg_line > 0 -+ && !(option_mask32 & OPT_in_place) /* but not for -i */ -+ ) { - sed_cmd->beg_line = -2; -+ } - sed_cmd->in_match = !( - /* has the ending line come, or is this a single address command? */ - (sed_cmd->end_line ? -@@ -1270,9 +1277,6 @@ static void add_cmd_block(char *cmdstr) - int sed_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; - int sed_main(int argc UNUSED_PARAM, char **argv) - { -- enum { -- OPT_in_place = 1 << 0, -- }; - unsigned opt; - llist_t *opt_e, *opt_f; - int status = EXIT_SUCCESS; -@@ -1292,6 +1296,7 @@ int sed_main(int argc UNUSED_PARAM, char - opt_e = opt_f = NULL; - opt_complementary = "e::f::" /* can occur multiple times */ - "nn"; /* count -n */ -+ /* -i must be first, to match OPT_in_place definition */ - opt = getopt32(argv, "irne:f:", &opt_e, &opt_f, - &G.be_quiet); /* counter for -n */ - //argc -= optind; ---- a/testsuite/sed.tests -+++ b/testsuite/sed.tests -@@ -270,11 +270,16 @@ testing "sed a cmd ended by double backs - | two \\ - ' - --# fisrt three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges -+# first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges - testing "sed with N skipping lines past ranges on next cmds" \ - "sed -n '1{N;N;d};1p;2,3p;3p;4p'" \ - "4\n4\n" "" "1\n2\n3\n4\n" - -+testing "sed -i with address modifies all files, not only first" \ -+ "cp input input2; sed -i -e '1s/foo/bar/' input input2 && cat input input2; rm input2" \ -+ "bar\nbar\n" "foo\n" "" -+ -+ - # testing "description" "arguments" "result" "infile" "stdin" - - exit $FAILCOUNT diff --git a/package/busybox/patches/922-shell.patch b/package/busybox/patches/922-shell.patch deleted file mode 100644 index 4f0058e38..000000000 --- a/package/busybox/patches/922-shell.patch +++ /dev/null @@ -1,98 +0,0 @@ ---- a/shell/ash.c -+++ b/shell/ash.c -@@ -4515,6 +4515,7 @@ clear_traps(void) - INT_ON; - } - } -+ may_have_traps = 0; - } - - /* Lives far away from here, needed for forkchild */ ---- /dev/null -+++ b/shell/ash_test/ash-signals/signal7.right -@@ -0,0 +1 @@ -+Bug detected: 0 ---- /dev/null -+++ b/shell/ash_test/ash-signals/signal7.tests -@@ -0,0 +1,18 @@ -+bug() { -+ trap : exit -+ # Bug was causing sh to be run in subshell, -+ # as if this line is replaced with (sh -c ...; exit $?) & -+ # here: -+ sh -c 'echo REAL_CHILD=$$' & -+ echo PARENTS_IDEA_OF_CHILD=$! -+ wait # make sure bkgd shell completes -+} -+ -+bug | { -+while read varval; do -+ eval $varval -+done -+test x"$REAL_CHILD" != x"" \ -+&& test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD" -+echo "Bug detected: $?" -+} ---- a/shell/hush.c -+++ b/shell/hush.c -@@ -3901,8 +3901,6 @@ static void insert_bg_job(struct pipe *p - - if (G_interactive_fd) - printf("[%d] %d %s\n", job->jobid, job->cmds[0].pid, job->cmdtext); -- /* Last command's pid goes to $! */ -- G.last_bg_pid = job->cmds[job->num_cmds - 1].pid; - G.last_jobid = job->jobid; - } - -@@ -4825,6 +4823,8 @@ static int run_list(struct pipe *pi) - if (G.run_list_level == 1) - insert_bg_job(pi); - #endif -+ /* Last command's pid goes to $! */ -+ G.last_bg_pid = pi->cmds[pi->num_cmds - 1].pid; - G.last_exitcode = rcode = EXIT_SUCCESS; - debug_printf_exec(": cmd&: exitcode EXIT_SUCCESS\n"); - } else { ---- /dev/null -+++ b/shell/hush_test/hush-trap/signal7.right -@@ -0,0 +1 @@ -+Bug detected: 0 ---- /dev/null -+++ b/shell/hush_test/hush-trap/signal7.tests -@@ -0,0 +1,18 @@ -+bug() { -+ trap : exit -+ # Bug was causing sh to be run in subshell, -+ # as if this line is replaced with (sh -c ...; exit $?) & -+ # here: -+ sh -c 'echo REAL_CHILD=$$' & -+ echo PARENTS_IDEA_OF_CHILD=$! -+ wait # make sure bkgd shell completes -+} -+ -+bug | { -+while read varval; do -+ eval $varval -+done -+test x"$REAL_CHILD" != x"" \ -+&& test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD" -+echo "Bug detected: $?" -+} ---- a/shell/shell_common.c -+++ b/shell/shell_common.c -@@ -428,9 +428,14 @@ shell_builtin_ulimit(char **argv) - val <<= l->factor_shift; - } - //bb_error_msg("opt %c val_str:'%s' val:%lld", opt_char, val_str, (long long)val); -+ /* from man bash: "If neither -H nor -S -+ * is specified, both the soft and hard -+ * limits are set. */ -+ if (!opts) -+ opts = OPT_hard + OPT_soft; - if (opts & OPT_hard) - limit.rlim_max = val; -- if ((opts & OPT_soft) || opts == 0) -+ if (opts & OPT_soft) - limit.rlim_cur = val; - //bb_error_msg("setrlimit(%d, %lld, %lld)", l->cmd, (long long)limit.rlim_cur, (long long)limit.rlim_max); - if (setrlimit(l->cmd, &limit) < 0) { -- cgit v1.2.3