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

Bug#833970: netkit-rsh: uses deprecated BSD union wait type



Source: netkit-rsh
Version: 0.17-15
Severity: important
Tags: patch upstream

Dear Maintainer,

glibc 2.24 has removed the deprecated BSD union wait type if favor of
the POSIX.1 interface using W* macros from <sys/wait.h> (such as
WEXITSTATUS) [1].

glibc 2.24 is already available in experimental and will plan to upload
it to sid in the next days/weeks. This will cause netkit-rsh to fail to
build from source. You will find attached a patch to fix the issue. It
unconditionally uses the "new" interface, but it should be available on
all recent UNIXes including the BSDs, given POSIX.1 dates back from
1988. The GNU libc has it since at least 1995, probably even earlier.

Please also note that this will not break the existing binaries, just
building the package from source.

Thanks,
Aurelien

[1] https://sourceware.org/ml/libc-alpha/2016-02/msg00342.html

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -u netkit-rsh-0.17/rlogin/rlogin.c netkit-rsh-0.17/rlogin/rlogin.c
--- netkit-rsh-0.17/rlogin/rlogin.c
+++ netkit-rsh-0.17/rlogin/rlogin.c
@@ -460,7 +460,7 @@
 void
 catch_child(int ignore)
 {
-	union wait status;
+	int status;
 	int pid;
 
 	(void)ignore;
@@ -471,7 +471,7 @@
 			return;
 		/* if the child (reader) dies, just quit */
 		if (pid < 0 || (pid == childpid && !WIFSTOPPED(status)))
-			done((int)(status.w_termsig | status.w_retcode));
+			done((int)(WTERMSIG(status) | WEXITSTATUS(status)));
 	}
 	/* NOTREACHED */
 }

Reply to: