NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/41313: getutentries() in src/usr.bin/who/utmpentry.c thinks there are no entries if only one of utmp/utmpx support is selected



>Number:         41313
>Category:       bin
>Synopsis:       getutentries() in src/usr.bin/who/utmpentry.c thinks there are 
>no entries if only one of utmp/utmpx support is selected
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 01 02:50:00 +0000 2009
>Originator:     Chris Spiegel
>Release:        5.0
>Organization:
>Environment:
N/A (encountered while porting to another OS)
>Description:
Due to a logic bug, the getutentries() function in src/usr.bin/who/utmpentry.c 
returns zero entries if only one of SUPPORT_UTMP and SUPPORT_UTMPX is defined; 
it works fine if both are defined.
>How-To-Repeat:

>Fix:
Here's a patch.  If spacing get mangled, well, it's probably easier to apply by 
hand anyway:

diff -ru who/utmpentry.c who.new/utmpentry.c
--- who/utmpentry.c     2008-10-28 07:01:46.000000000 -0700
+++ who.new/utmpentry.c 2009-04-30 19:38:00.573408209 -0700
@@ -242,7 +242,7 @@
        }
 #endif
        numutmp = 0;
-#if defined(SUPPORT_UTMP) && defined(SUPPORT_UTMPX)
+#if defined(SUPPORT_UTMP) || defined(SUPPORT_UTMPX)
        if (ehead != NULL) {
                struct utmpentry *from = ehead, *save;
                



Home | Main Index | Thread Index | Old Index