diff -Nru busybox-1.30.1/debian/changelog busybox-1.30.1/debian/changelog --- busybox-1.30.1/debian/changelog 2020-09-18 13:47:43.000000000 +0000 +++ busybox-1.30.1/debian/changelog 2020-11-11 12:15:02.000000000 +0000 @@ -1,3 +1,10 @@ +busybox (1:1.30.1-4ubuntu6.3) focal; urgency=medium + + * cherry-pick settimeofday for glibc v2.31+ compatibility fix for upstream + (LP: #1888543) + + -- Balint Reczey Wed, 11 Nov 2020 13:15:02 +0100 + busybox (1:1.30.1-4ubuntu6.2) focal-security; urgency=medium * SECURITY UPDATE: missing ssl cert validation in wget applet diff -Nru busybox-1.30.1/debian/patches/cherry-pick.1_32_0-26-g1a5d6fcbb.hwclock-fix-settimeofday-for-glibc-v2.31.patch busybox-1.30.1/debian/patches/cherry-pick.1_32_0-26-g1a5d6fcbb.hwclock-fix-settimeofday-for-glibc-v2.31.patch --- busybox-1.30.1/debian/patches/cherry-pick.1_32_0-26-g1a5d6fcbb.hwclock-fix-settimeofday-for-glibc-v2.31.patch 1970-01-01 00:00:00.000000000 +0000 +++ busybox-1.30.1/debian/patches/cherry-pick.1_32_0-26-g1a5d6fcbb.hwclock-fix-settimeofday-for-glibc-v2.31.patch 2020-11-11 12:15:02.000000000 +0000 @@ -0,0 +1,53 @@ +Subject: hwclock: Fix settimeofday for glibc v2.31+ +Origin: 1_32_0-26-g1a5d6fcbb +Upstream-Author: Eddie James +Date: Mon Aug 10 09:59:02 2020 -0500 +Bug-Debian: https://bugs.debian.org/966074 + + hwclock: Fix settimeofday for glibc v2.31+ + + The glibc implementation changed for settimeofday, resulting in "invalid + argument" error when attempting to set both timezone and time with a single + call. Fix this by calling settimeofday twice + + Signed-off-by: Eddie James + Signed-off-by: Denys Vlasenko + +--- a/util-linux/hwclock.c ++++ b/util-linux/hwclock.c +@@ -122,16 +122,20 @@ + struct timeval tv; + struct timezone tz; + +- tz.tz_minuteswest = timezone/60; ++ tz.tz_minuteswest = timezone / 60; + /* ^^^ used to also subtract 60*daylight, but it's wrong: + * daylight!=0 means "this timezone has some DST + * during the year", not "DST is in effect now". + */ + tz.tz_dsttime = 0; + ++ /* glibc v2.31+ returns an error if both args are non-NULL */ ++ if (settimeofday(NULL, &tz)) ++ bb_simple_perror_msg_and_die("settimeofday"); ++ + tv.tv_sec = read_rtc(pp_rtcname, NULL, utc); + tv.tv_usec = 0; +- if (settimeofday(&tv, &tz)) ++ if (settimeofday(&tv, NULL)) + bb_perror_msg_and_die("settimeofday"); + } + +@@ -283,7 +287,11 @@ + gettimeofday(&tv, NULL); + if (!utc) + tv.tv_sec += tz.tz_minuteswest * 60; +- if (settimeofday(&tv, &tz)) ++ ++ /* glibc v2.31+ returns an error if both args are non-NULL */ ++ if (settimeofday(NULL, &tz)) ++ bb_perror_msg_and_die("settimeofday"); ++ if (settimeofday(&tv, NULL)) + bb_perror_msg_and_die("settimeofday"); + } + diff -Nru busybox-1.30.1/debian/patches/series busybox-1.30.1/debian/patches/series --- busybox-1.30.1/debian/patches/series 2020-09-18 13:47:43.000000000 +0000 +++ busybox-1.30.1/debian/patches/series 2020-11-11 12:15:02.000000000 +0000 @@ -1,6 +1,7 @@ # cherry-picked from upstream cherry-pick.1_30_0-35-g74d9f1ba3.udhcpc-when-decoding-dhcp-subnet-ensure-it-is-4-bytes-long.patch cherry-pick.1_30_0-110-gbb3a9531b.ip-fix-ip-o-link.patch +cherry-pick.1_32_0-26-g1a5d6fcbb.hwclock-fix-settimeofday-for-glibc-v2.31.patch # The following patches will likely be merged soon u-mount-FreeBSD-support.patch