Package: rungetty
Version: 1.2-16
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu hirsute ubuntu-patch
X-Debbugs-Cc: lo...@ubuntu.com

Hi,

rungetty currently FTBFS against glibc 2.32, which is used in the
development release of Ubuntu (and should be in Debian soon).

This is because it uses sys_errlist instead of strerror(), which is also
supported in earlier versions of glibc.

In Ubuntu, the attached patch was applied to achieve the following:

  * Fix FTBFS against glibc 2.32 by using strerror() instead of sys_errlist.

Thanks for considering the patch.

Logan
diff -Nru rungetty-1.2/debian/patches/glibc-2.32.patch 
rungetty-1.2/debian/patches/glibc-2.32.patch
--- rungetty-1.2/debian/patches/glibc-2.32.patch        1969-12-31 
19:00:00.000000000 -0500
+++ rungetty-1.2/debian/patches/glibc-2.32.patch        2021-01-10 
19:01:08.000000000 -0500
@@ -0,0 +1,60 @@
+--- a/rungetty.c
++++ b/rungetty.c
+@@ -313,7 +313,7 @@
+           {
+             if (errno == EINTR || errno == EIO || errno == ENOENT)
+               exit (0);
+-            error ("%s: read: %s", tty, sys_errlist[errno]);
++            error ("%s: read: %s", tty, strerror(errno));
+           }
+         if (c == '\n' || c == '\r')
+           {
+@@ -430,7 +430,7 @@
+       while ((logname = get_logname ()) == 0);
+       execl (_PATH_LOGIN, _PATH_LOGIN, "--", logname, NULL);
+     }
+-  error ("%s: can't exec " _PATH_LOGIN ": %s", tty, sys_errlist[errno]);
++  error ("%s: can't exec " _PATH_LOGIN ": %s", tty, strerror(errno));
+   exit (0);
+ }
+ 
+@@ -446,7 +446,7 @@
+   strcpy (buf, "/dev/");
+   strcat (buf, tty);
+   if (chown (buf, 0, 0) || chmod (buf, 0600))
+-    error ("%s: %s", buf, sys_errlist[errno]);
++    error ("%s: %s", buf, strerror(errno));
+ 
+   sa.sa_handler = SIG_IGN;
+   sa.sa_flags = 0;
+@@ -461,7 +461,7 @@
+    */
+   if ((fd = open (buf, O_RDWR, 0)) < 0
+       || ioctl (fd, TIOCSCTTY, (void *) 1) == -1)
+-    error ("%s: cannot open tty: %s", buf, sys_errlist[errno]);
++    error ("%s: cannot open tty: %s", buf, strerror(errno));
+   if (!isatty (fd))
+     error ("%s: not a tty", buf);
+ 
+@@ -475,11 +475,11 @@
+ 
+   if (open (buf, O_RDWR, 0) != 0)
+     error ("%s: cannot open as standard input: %s", buf,
+-         sys_errlist[errno]);
++         strerror(errno));
+ 
+   /* Set up standard output and standard error file descriptors. */
+   if (dup (0) != 1 || dup (0) != 2)
+-    error ("%s: dup problem: %s", buf, sys_errlist[errno]);
++    error ("%s: dup problem: %s", buf, strerror(errno));
+ 
+   /* Write a reset string to the terminal. This is very linux-specific
+      and should be checked for other systems. */
+@@ -606,6 +606,6 @@
+   nice (priority);
+ 
+   execvp (program_run, &argv[optind + 1]);
+-  error ("%s: can't exec %s : %s", tty, program_run, sys_errlist[errno]);
++  error ("%s: can't exec %s : %s", tty, program_run, strerror(errno));
+   exit (0);
+ }
diff -Nru rungetty-1.2/debian/patches/series rungetty-1.2/debian/patches/series
--- rungetty-1.2/debian/patches/series  2016-01-04 13:13:07.000000000 -0500
+++ rungetty-1.2/debian/patches/series  2021-01-10 19:00:04.000000000 -0500
@@ -6,3 +6,4 @@
 06_initgroups
 07_clear-not-reset
 08_autologin-on-all-ttys
+glibc-2.32.patch

Reply via email to