[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#955368: busybox FTBFS with glibc 2.31 (references to obsolete 'stime')



Package: busybox
Version: 1:1.30.1-4
Severity: important
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu focal ubuntu-patch

Dear maintainers,

In Ubuntu, the busybox package has begun to FTBFS because Ubuntu has moved
to glibc 2.31, which has obsoleted the stime() function and busybox still
calls this function.

The attached patch has been uploaded to Ubuntu, replacing the calls to
stime() with clock_settime(), per the glibc upstream documentation.

This is not a serious bug today in Debian because glibc 2.31 is only in
experimental, but at some point it will become a serious FTBFS.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org
diff -Nru busybox-1.30.1/debian/patches/series busybox-1.30.1/debian/patches/series
--- busybox-1.30.1/debian/patches/series	2019-05-23 06:37:05.000000000 -0700
+++ busybox-1.30.1/debian/patches/series	2020-03-30 07:43:36.000000000 -0700
@@ -14,3 +14,4 @@
 temp-deb-installer-hack.patch
 install-readlink-in-bin.patch
 ignore-ip-valid_lft.patch
+stime-is-clock_settime.patch
diff -Nru busybox-1.30.1/debian/patches/stime-is-clock_settime.patch busybox-1.30.1/debian/patches/stime-is-clock_settime.patch
--- busybox-1.30.1/debian/patches/stime-is-clock_settime.patch	1969-12-31 16:00:00.000000000 -0800
+++ busybox-1.30.1/debian/patches/stime-is-clock_settime.patch	2020-03-30 08:37:00.000000000 -0700
@@ -0,0 +1,46 @@
+Description: stime is obsolete, use clock_settime instead
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Last-Update: 2020-03-30
+
+Index: busybox-1.30.1/util-linux/rdate.c
+===================================================================
+--- busybox-1.30.1.orig/util-linux/rdate.c
++++ busybox-1.30.1/util-linux/rdate.c
+@@ -79,11 +79,13 @@
+ int rdate_main(int argc UNUSED_PARAM, char **argv)
+ {
+ 	time_t remote_time;
++	struct timespec remote_timespec = { 0, 0 };
+ 	unsigned flags;
+ 
+ 	flags = getopt32(argv, "^" "sp" "\0" "-1");
+ 
+ 	remote_time = askremotedate(argv[optind]);
++	remote_timespec.tv_sec = remote_time;
+ 
+ 	/* Manpages of various Unixes are confusing. What happens is:
+ 	 * (no opts) set and print time
+@@ -96,7 +98,7 @@
+ 		if (time(NULL) == remote_time)
+ 			bb_error_msg("current time matches remote time");
+ 		else
+-			if (stime(&remote_time) < 0)
++			if (clock_settime(CLOCK_REALTIME, &remote_timespec) < 0)
+ 				bb_perror_msg_and_die("can't set time of day");
+ 	}
+ 
+Index: busybox-1.30.1/coreutils/date.c
+===================================================================
+--- busybox-1.30.1.orig/coreutils/date.c
++++ busybox-1.30.1/coreutils/date.c
+@@ -303,7 +303,9 @@
+ 		ts.tv_sec = validate_tm_time(date_str, &tm_time);
+ 
+ 		/* if setting time, set it */
+-		if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) {
++		if ((opt & OPT_SET)
++		    && clock_settime(CLOCK_REALTIME, &ts.tv_sec) < 0)
++		{
+ 			bb_perror_msg("can't set date");
+ 		}
+ 	}

Reply to: