NetBSD Problem Report #41313
From www@NetBSD.org Fri May 1 02:45:53 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id 6A12363BC38
for <gnats-bugs@gnats.netbsd.org>; Fri, 1 May 2009 02:45:53 +0000 (UTC)
Message-Id: <20090501024553.377AB63B8A5@www.NetBSD.org>
Date: Fri, 1 May 2009 02:45:53 +0000 (UTC)
From: netbsd@happyjack.org
Reply-To: netbsd@happyjack.org
To: gnats-bugs@NetBSD.org
Subject: getutentries() in src/usr.bin/who/utmpentry.c thinks there are no entries if only one of utmp/utmpx support is selected
X-Send-Pr-Version: www-1.0
>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: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 01 02:50:00 +0000 2009
>Closed-Date: Fri May 01 14:26:47 +0000 2009
>Last-Modified: Fri May 01 14:30:02 +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;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: christos@NetBSD.org
State-Changed-When: Fri, 01 May 2009 10:26:47 -0400
State-Changed-Why:
fixed, thanks
From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/41313 CVS commit: src/usr.bin/who
Date: Fri, 1 May 2009 10:26:10 -0400
Module Name: src
Committed By: christos
Date: Fri May 1 14:26:10 UTC 2009
Modified Files:
src/usr.bin/who: utmpentry.c
Log Message:
PR/41313: Chris Spiegel: getutentries() in src/usr.bin/who/utmpentry.c thinks
there are no entries if only one of utmp/utmpx support is selected
mangled && -> ||
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/who/utmpentry.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.