busybox: add an upstream ntpd fix (#12841)
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 19 Jan 2013 10:11:34 +0000 (10:11 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 19 Jan 2013 10:11:34 +0000 (10:11 +0000)
SVN-Revision: 35239

package/busybox/Makefile
package/busybox/patches/004-upstream-percent_decode_in_place.patch
package/busybox/patches/006-upstream_CVE-2011-2716_fixes.patch
package/busybox/patches/611-upstream_ntpd_version_fix.patch [new file with mode: 0644]
package/busybox/patches/911-date-k-flag.patch
package/busybox/patches/998-arping_missing_includes.patch
package/busybox/patches/999-musl-fixes.patch

index 0450d897e32a0d7d55bc185b0efde09b7b2e74d6..7aaaf6cb173ccbc9410b444fe273f889824044a3 100644 (file)
@@ -1,5 +1,5 @@
 # 
-# Copyright (C) 2006-2012 OpenWrt.org
+# Copyright (C) 2006-2013 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.19.4
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
index d94ee479000157f95442889a1d9cfc645d8088d5..bef4a90790e10e41a46cd6b609461a84a03fe577 100644 (file)
@@ -222,7 +222,7 @@ Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
                h->host = sp + 1;
        }
  
-@@ -661,12 +666,6 @@ static void download_one_url(const char
+@@ -661,12 +666,6 @@ static void download_one_url(const char 
  
  #if ENABLE_FEATURE_WGET_AUTHENTICATION
                if (target.user) {
index 94d5f34a16c1e27d35152ebdd0b45f5b0ceb67de..532fcee0fb51f9a926f06c34fa1aeb96715244c1 100644 (file)
@@ -1,5 +1,5 @@
---- busybox-1.19.4/networking/udhcp/common.c
-+++ busybox-1.19.4-udhcp/networking/udhcp/common.c
+--- a/networking/udhcp/common.c
++++ b/networking/udhcp/common.c
 @@ -29,16 +29,16 @@ const struct dhcp_optflag dhcp_optflags[
  //    { OPTION_IP | OPTION_LIST                 , 0x07 }, /* DHCP_LOG_SERVER    */
  //    { OPTION_IP | OPTION_LIST                 , 0x08 }, /* DHCP_COOKIE_SERVER */
@@ -56,8 +56,8 @@
  #if ENABLE_FEATURE_UDHCP_RFC3397
                case OPTION_DNS_STRING:
  #endif
---- busybox-1.19.4/networking/udhcp/common.h
-+++ busybox-1.19.4-udhcp/networking/udhcp/common.h
+--- a/networking/udhcp/common.h
++++ b/networking/udhcp/common.h
 @@ -80,6 +80,9 @@ enum {
        OPTION_IP = 1,
        OPTION_IP_PAIR,
@@ -68,8 +68,8 @@
  //    OPTION_BOOLEAN,
        OPTION_U8,
        OPTION_U16,
---- busybox-1.19.4/networking/udhcp/dhcpc.c
-+++ busybox-1.19.4-udhcp/networking/udhcp/dhcpc.c
+--- a/networking/udhcp/dhcpc.c
++++ b/networking/udhcp/dhcpc.c
 @@ -101,6 +101,7 @@ static const uint8_t len_of_option_as_st
        [OPTION_IP_PAIR         ] = sizeof("255.255.255.255 ") * 2,
        [OPTION_STATIC_ROUTES   ] = sizeof("255.255.255.255/32 255.255.255.255 "),
diff --git a/package/busybox/patches/611-upstream_ntpd_version_fix.patch b/package/busybox/patches/611-upstream_ntpd_version_fix.patch
new file mode 100644 (file)
index 0000000..7bcb847
--- /dev/null
@@ -0,0 +1,29 @@
+From b7841cf7b919b16d1bd4619154bf7cb4c22b4ccd Mon Sep 17 00:00:00 2001
+From: Paul Marks <paul@pmarks.net>
+Date: Mon, 14 Jan 2013 01:39:10 +0000
+Subject: ntpd: fix incorrect m_status field in outgoing packets. Closes 5120
+
+When using busybox ntpd with an NTPv3 client and NTPv4 server (or vice
+versa), the version numbers can be incorrectly ORed together, yielding
+the bogus value of "NTPv7".  This makes ntpd unusable with clients
+such as Chrony and Windows "Internet Time".
+
+This patch avoids the version mangling, by copying only the Leap
+Indicator bits from the server's status field.
+
+Signed-off-by: Paul Marks <paul@pmarks.net>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+(limited to 'networking/ntpd.c')
+
+--- a/networking/ntpd.c
++++ b/networking/ntpd.c
+@@ -1794,7 +1794,7 @@ recv_and_process_client_pkt(void /*int f
+       /* Build a reply packet */
+       memset(&msg, 0, sizeof(msg));
+-      msg.m_status = G.stratum < MAXSTRAT ? G.ntp_status : LI_ALARM;
++      msg.m_status = G.stratum < MAXSTRAT ? (G.ntp_status & LI_MASK) : LI_ALARM;
+       msg.m_status |= (query_status & VERSION_MASK);
+       msg.m_status |= ((query_status & MODE_MASK) == MODE_CLIENT) ?
+                        MODE_SERVER : MODE_SYM_PAS;
index 71f2af5c9b257924c7d632dd93e4f80519334198..c55ee233697dfe33147e60a73c79fcb03fb9be80 100644 (file)
@@ -1,6 +1,5 @@
-diff -urN busybox-1.19.4/coreutils/date.c busybox-1.19.4.new/coreutils/date.c
---- busybox-1.19.4/coreutils/date.c    2012-02-04 20:24:55.000000000 +0100
-+++ busybox-1.19.4.new/coreutils/date.c        2012-11-23 16:48:21.945200539 +0100
+--- a/coreutils/date.c
++++ b/coreutils/date.c
 @@ -123,6 +123,7 @@
  //usage:      IF_FEATURE_DATE_ISOFMT(
  //usage:     "\n      -D FMT          Use FMT for -d TIME conversion"
@@ -17,7 +16,7 @@ diff -urN busybox-1.19.4/coreutils/date.c busybox-1.19.4.new/coreutils/date.c
  #if ENABLE_FEATURE_DATE_NANO
  # include <sys/syscall.h>
  #endif
-@@ -145,8 +147,9 @@
+@@ -145,8 +147,9 @@ enum {
        OPT_UTC       = (1 << 2), /* u */
        OPT_DATE      = (1 << 3), /* d */
        OPT_REFERENCE = (1 << 4), /* r */
@@ -29,7 +28,7 @@ diff -urN busybox-1.19.4/coreutils/date.c busybox-1.19.4.new/coreutils/date.c
  };
  
  static void maybe_set_utc(int opt)
-@@ -164,12 +167,15 @@
+@@ -164,12 +167,15 @@ static const char date_longopts[] ALIGN1
        /*      "universal\0" No_argument       "u" */
                "date\0"      Required_argument "d"
                "reference\0" Required_argument "r"
@@ -45,7 +44,7 @@ diff -urN busybox-1.19.4/coreutils/date.c busybox-1.19.4.new/coreutils/date.c
        struct timespec ts;
        struct tm tm_time;
        char buf_fmt_dt2str[64];
-@@ -184,7 +190,7 @@
+@@ -184,7 +190,7 @@ int date_main(int argc UNUSED_PARAM, cha
        opt_complementary = "d--s:s--d"
                IF_FEATURE_DATE_ISOFMT(":R--I:I--R");
        IF_LONG_OPTS(applet_long_options = date_longopts;)
@@ -54,7 +53,7 @@ diff -urN busybox-1.19.4/coreutils/date.c busybox-1.19.4.new/coreutils/date.c
                        IF_FEATURE_DATE_ISOFMT("I::D:"),
                        &date_str, &date_str, &filename
                        IF_FEATURE_DATE_ISOFMT(, &isofmt_arg, &fmt_str2dt));
-@@ -241,6 +247,31 @@
+@@ -241,6 +247,31 @@ int date_main(int argc UNUSED_PARAM, cha
        if (*argv)
                bb_show_usage();
  
index 07c7dd4c00c036aa1ac2f437e75dd3b32b6c54fa..a9d4a62af34fca8d0e2134f8f6ceb6d4f2e7ed06 100644 (file)
@@ -1,6 +1,5 @@
-diff -urN busybox-1.19.4/networking/arping.c busybox-1.19.4.new/networking/arping.c
---- busybox-1.19.4/networking/arping.c 2012-02-04 20:24:55.000000000 +0100
-+++ busybox-1.19.4.new/networking/arping.c     2012-11-23 17:22:13.753252564 +0100
+--- a/networking/arping.c
++++ b/networking/arping.c
 @@ -24,6 +24,8 @@
  
  #include <arpa/inet.h>
index e0bc9a87dbd818ba76f381afd164dcc07948befd..b528b3e81b3249d3ca646f93ca49a1ce4da732cc 100644 (file)
@@ -1,7 +1,6 @@
-diff -Naur busybox-1.19.3-old/include/platform.h busybox-1.19.3/include/platform.h
---- busybox-1.19.3-old/include/platform.h      2011-10-29 05:43:01.000000000 -0600
-+++ busybox-1.19.3/include/platform.h  2011-12-18 15:53:49.817278374 -0700
-@@ -443,6 +443,13 @@
+--- a/include/platform.h
++++ b/include/platform.h
+@@ -443,6 +443,13 @@ typedef unsigned smalluint;
  # undef HAVE_NET_ETHERNET_H
  #endif