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

rpms/coreutils/FC-4 coreutils-stale-utmp.patch, 1.5, 1.6 coreutils.spec, 1.71, 1.72



Author: twaugh

Update of /cvs/dist/rpms/coreutils/FC-4
In directory cvs.devel.redhat.com:/tmp/cvs-serv21387

Modified Files:
	coreutils-stale-utmp.patch coreutils.spec 
Log Message:
* Mon Jul 25 2005 Tim Waugh <twaugh redhat com> 5.2.1-48.1
- 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/FC-4/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	25 Jul 2005 15:33:32 -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/FC-4/coreutils.spec,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- coreutils.spec	25 May 2005 09:39:05 -0000	1.71
+++ coreutils.spec	25 Jul 2005 15:33:32 -0000	1.72
@@ -1,7 +1,7 @@
 Summary: The GNU core utilities: a set of tools commonly used in shell scripts
 Name:    coreutils
 Version: 5.2.1
-Release: 48
+Release: 48.1
 License: GPL
 Group:   System Environment/Base
 Url:     http://www.gnu.org/software/coreutils/
@@ -250,6 +250,10 @@
 /sbin/runuser
 
 %changelog
+* Mon Jul 25 2005 Tim Waugh <twaugh redhat com> 5.2.1-48.1
+- Fixed stale-utmp patch so that 'who -r' and 'who -b' work
+  again (bug #161264).
+
 * Wed May 25 2005 Tim Waugh <twaugh redhat com> 5.2.1-48
 - Prevent buffer overflow in who(1) (bug #158405).
 


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