components/coreutils/patches/who.c.patch
author William.D.Johnston <William.D.Johnston@oracle.com>
Sun, 12 Jul 2015 15:01:25 -0700
changeset 4634 a4940ac4947c
parent 2050 7c6a1559c620
permissions -rw-r--r--
20886490 proftpd can't open wtmpx after one login failure, doesn't register the ftp login 20717794 proftpd changes group ownership of file /etc/shadow after user login failure 19318572 root logins can't get all privilege when Solaris PrivilegeEngine enabled

Needed so that GNU 'who -r' correctly prints the run-level.
See CR #15651288 for more details.

This patch has not been passed upstream yet. It needs to be reworked into
a format that would be acceptable.

--- src/who.c.orig	2014-07-27 14:59:42.573346371 -0700
+++ src/who.c	2014-07-27 15:00:16.713849303 -0700
@@ -514,8 +514,8 @@
   unsigned char curr = UT_PID (utmp_ent) % 256;
 
   if (!runlevline)
-    runlevline = xmalloc (strlen (_("run-level")) + 3);
-  sprintf (runlevline, "%s %c", _("run-level"), curr);
+    runlevline = xmalloc (sizeof (utmp_ent->ut_line));
+  sprintf (runlevline, "%s", utmp_ent->ut_line);
 
   if (!comment)
     comment = xmalloc (strlen (_("last=")) + 2);