rpms/coreutils/devel coreutils-stale-utmp.patch, 1.5, 1.6 coreutils.spec, 1.77, 1.78
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Jun 22 13:03:10 UTC 2005
Author: twaugh
Update of /cvs/dist/rpms/coreutils/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv16313
Modified Files:
coreutils-stale-utmp.patch coreutils.spec
Log Message:
* Wed Jun 22 2005 Tim Waugh <twaugh at redhat.com>
- Fixed stale-utmp patch so that 'who -r' and 'who -b' work
again (bug #161264).
coreutils-stale-utmp.patch:
lib/readutmp.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++-----------
lib/readutmp.h | 15 +++++++++++-
m4/readutmp.m4 | 5 ++--
src/pinky.c | 2 -
src/uptime.c | 11 +++++----
src/users.c | 11 +++++----
src/who.c | 21 +++++++----------
7 files changed, 94 insertions(+), 38 deletions(-)
Index: coreutils-stale-utmp.patch
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils-stale-utmp.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- coreutils-stale-utmp.patch 15 Apr 2005 16:32:26 -0000 1.5
+++ coreutils-stale-utmp.patch 22 Jun 2005 13:03:08 -0000 1.6
@@ -1,5 +1,5 @@
---- coreutils-5.2.1/lib/readutmp.c 2005-03-29 13:20:09.000000000 +0100
-+++ coreutils-5.2.1/lib/readutmp.c 2005-04-08 17:44:56.000000000 +0100
+--- coreutils-5.2.1/lib/readutmp.c 2005-04-08 17:44:56.000000000 +0100
++++ coreutils-5.2.1/lib/readutmp.c 2005-06-22 13:56:54.000000000 +0100
@@ -23,6 +23,8 @@
#include <sys/types.h>
@@ -20,7 +20,7 @@
/* Copy UT->ut_name into storage obtained from malloc. Then remove any
trailing spaces from the copy, NUL terminate it, and return the copy. */
-@@ -49,17 +55,30 @@
+@@ -49,17 +55,45 @@
return trimmed_name;
}
@@ -29,7 +29,22 @@
+static inline bool
+desirable_utmp_entry (STRUCT_UTMP const *u, int options)
+{
++#define UT_TYPE_UNDEF 255
++
++#if HAVE_STRUCT_XTMP_UT_TYPE
++# define UT_TYPE(U) ((U)->ut_type)
++#else
++# define UT_TYPE(U) UT_TYPE_UNDEF
++#endif
++
++#define IS_USER_PROCESS(U) \
++ (UT_USER (U)[0] \
++ && (UT_TYPE (U) == USER_PROCESS \
++ || (UT_TYPE (U) == UT_TYPE_UNDEF \
++ && UT_TIME_MEMBER (U) != 0)))
++
+ return ! (options & READ_UTMP_CHECK_PIDS
++ && IS_USER_PROCESS (u)
+ && (UT_PID (u) <= 0
+ || (kill (UT_PID (u), 0) < 0 && errno == ESRCH)));
+}
@@ -54,7 +69,7 @@
STRUCT_UTMP *u;
STRUCT_UTMP *utmp = NULL;
-@@ -71,15 +90,15 @@
+@@ -71,15 +105,15 @@
SET_UTMP_ENT ();
@@ -78,7 +93,7 @@
END_UTMP_ENT ();
-@@ -98,6 +117,8 @@
+@@ -98,6 +132,8 @@
struct stat file_stats;
size_t n_read;
size_t size;
@@ -87,7 +102,7 @@
STRUCT_UTMP *buf;
utmp = fopen (filename, "r");
-@@ -111,6 +132,8 @@
+@@ -111,6 +147,8 @@
errno = e;
return 1;
}
@@ -96,7 +111,7 @@
size = file_stats.st_size;
buf = xmalloc (size);
n_read = fread (buf, sizeof *buf, size / sizeof *buf, utmp);
-@@ -130,7 +153,12 @@
+@@ -130,7 +168,12 @@
return 1;
}
Index: coreutils.spec
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils.spec,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- coreutils.spec 17 Jun 2005 08:05:14 -0000 1.77
+++ coreutils.spec 22 Jun 2005 13:03:08 -0000 1.78
@@ -252,6 +252,10 @@
/sbin/runuser
%changelog
+* Wed Jun 22 2005 Tim Waugh <twaugh at redhat.com>
+- Fixed stale-utmp patch so that 'who -r' and 'who -b' work
+ again (bug #161264).
+
* Fri Jun 17 2005 Tim Waugh <twaugh at redhat.com> 5.2.1-51
- Use upstream hostid fix.
More information about the fedora-cvs-commits
mailing list