Commit 67c8c703 authored by Gustavo Zacarias's avatar Gustavo Zacarias Committed by Peter Korsgaard
Browse files

busybox: bump to version 1.23.0

parent 08b1c665
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
Upstream http://busybox.net/downloads/fixes-1.23.0/busybox-1.23.0-ash.patch
post-release hotfix patch for ash segfault.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

--- busybox-1.23.0/shell/ash.c
+++ busybox-1.23.0-ash/shell/ash.c
@@ -6746,6 +6746,14 @@ varvalue(char *name, int varflags, int f
 		len = strlen(p);
 		if (!(subtype == VSPLUS || subtype == VSLENGTH))
 			memtodest(p, len, syntax, quotes);
+#if ENABLE_UNICODE_SUPPORT
+		if (subtype == VSLENGTH && len > 0) {
+			reinit_unicode_for_ash();
+			if (unicode_status == UNICODE_ON) {
+				len = unicode_strlen(p);
+			}
+		}
+#endif
 		return len;
 	}
 
@@ -6829,15 +6837,7 @@ evalvar(char *p, int flags, struct strli
 		varunset(p, var, 0, 0);
 
 	if (subtype == VSLENGTH) {
-		ssize_t n = varlen;
-		if (n > 0) {
-			reinit_unicode_for_ash();
-			if (unicode_status == UNICODE_ON) {
-				const char *val = lookupvar(var);
-				n = unicode_strlen(val);
-			}
-		}
-		cvtnum(n > 0 ? n : 0);
+		cvtnum(varlen > 0 ? varlen : 0);
 		goto record;
 	}
 
+0 −11
Original line number Diff line number Diff line
--- busybox-1.22.1/shell/ash.c
+++ busybox-1.22.1-ash/shell/ash.c
@@ -13014,7 +13014,7 @@ init(void)
 		setvar2("PPID", utoa(getppid()));
 #if ENABLE_ASH_BASH_COMPAT
 		p = lookupvar("SHLVL");
-		setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1));
+		setvar("SHLVL", utoa((p ? atoi(p) : 0) + 1), VEXPORT);
 #endif
 		p = lookupvar("PWD");
 		if (p) {
+0 −30
Original line number Diff line number Diff line
--- busybox-1.22.1/libbb/time.c
+++ busybox-1.22.1-date/libbb/time.c
@@ -68,15 +68,23 @@ void FAST_FUNC parse_datestr(const char
 			/* else end != NUL and we error out */
 		}
 	} else
-	/* yyyy-mm-dd HH */
-	if (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
+	if (strchr(date_str, '-')
+	    /* Why strchr('-') check?
+	     * sscanf below will trash ptm->tm_year, this breaks
+	     * if parse_str is "10101010" (iow, "MMddhhmm" form)
+	     * because we destroy year. Do these sscanf
+	     * only if we saw a dash in parse_str.
+	     */
+		/* yyyy-mm-dd HH */
+	 && (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
 				&ptm->tm_mon, &ptm->tm_mday,
 				&ptm->tm_hour,
 				&end) >= 4
-	/* yyyy-mm-dd */
-	 || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
+		/* yyyy-mm-dd */
+	     || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
 				&ptm->tm_mon, &ptm->tm_mday,
 				&end) >= 3
+	    )
 	) {
 		ptm->tm_year -= 1900; /* Adjust years */
 		ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */
+0 −19
Original line number Diff line number Diff line
--- busybox-1.22.1/networking/libiproute/iplink.c
+++ busybox-1.22.1-iplink/networking/libiproute/iplink.c
@@ -31,6 +31,16 @@
 #ifndef IFLA_LINKINFO
 # define IFLA_LINKINFO 18
 # define IFLA_INFO_KIND 1
+# define IFLA_INFO_DATA 2
+#endif
+
+#ifndef IFLA_VLAN_MAX
+# define IFLA_VLAN_ID 1
+# define IFLA_VLAN_FLAGS 2
+struct ifla_vlan_flags {
+	uint32_t	flags;
+	uint32_t	mask;
+};
 #endif
 
 /* taken from linux/sockios.h */
Loading