rpms/coreutils/devel coreutils-stale-utmp.patch, NONE, 1.1 coreutils.spec, 1.54, 1.55
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Mar 23 14:52:16 UTC 2005
Update of /cvs/dist/rpms/coreutils/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv2875
Modified Files:
coreutils.spec
Added Files:
coreutils-stale-utmp.patch
Log Message:
* Wed Mar 23 2005 Tim Waugh <twaugh at redhat.com>
- Add who(1) patch to work around stale utmp entries (bug #109726).
coreutils-stale-utmp.patch:
who.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
--- NEW FILE coreutils-stale-utmp.patch ---
--- coreutils-5.2.1/src/who.c.stale-utmp 2005-03-23 13:43:55.000000000 +0000
+++ coreutils-5.2.1/src/who.c 2005-03-23 13:46:44.000000000 +0000
@@ -27,6 +27,8 @@
#include <config.h>
#include <getopt.h>
#include <stdio.h>
+#include <signal.h>
+#include <errno.h>
#include <sys/types.h>
#include "system.h"
@@ -521,7 +523,8 @@
while (n--)
{
- if (UT_USER (utmp_buf)[0] && UT_TYPE (utmp_buf) == USER_PROCESS)
+ if (UT_USER (utmp_buf)[0] && UT_TYPE (utmp_buf) == USER_PROCESS &&
+ !(kill(utmp_buf->ut_pid, 0) < 0 && errno == ESRCH))
{
char *trimmed_name;
@@ -567,7 +570,8 @@
strncmp (ttyname_b, utmp_buf->ut_line,
sizeof (utmp_buf->ut_line)) == 0)
{
- if (need_users && IS_USER_PROCESS (utmp_buf))
+ if (need_users && IS_USER_PROCESS (utmp_buf) &&
+ !(kill(utmp_buf->ut_pid, 0) < 0 && errno == ESRCH))
print_user (utmp_buf);
else if (need_runlevel && UT_TYPE (utmp_buf) == RUN_LVL)
print_runlevel (utmp_buf);
Index: coreutils.spec
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils.spec,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- coreutils.spec 15 Mar 2005 13:52:17 -0000 1.54
+++ coreutils.spec 23 Mar 2005 14:52:14 -0000 1.55
@@ -49,6 +49,7 @@
Patch909: coreutils-zh_CN.patch
Patch910: coreutils-gcc4.patch
Patch911: coreutils-brokentest.patch
+Patch912: coreutils-stale-utmp.patch
# From upstream
Patch920: coreutils-dateseconds.patch
@@ -112,6 +113,7 @@
%patch909 -p1 -b .zh_CN
%patch910 -p1 -b .gcc4
%patch911 -p1 -b .brokentest
+%patch912 -p1 -b .stale-utmp
# From upstream
%patch920 -p1 -b .dateseconds
@@ -255,6 +257,9 @@
/sbin/runuser
%changelog
+* Wed Mar 23 2005 Tim Waugh <twaugh at redhat.com>
+- Add who(1) patch to work around stale utmp entries (bug #109726).
+
* Wed Mar 14 2005 Tim Waugh <twaugh at redhat.com> 5.2.1-42
- Fixed pam patch.
- Fixed broken configure test.
More information about the fedora-cvs-commits
mailing list