NetBSD Problem Report #29850
From lukem@mewburn.net Fri Apr 1 00:17:45 2005
Return-Path: <lukem@mewburn.net>
Received: from home.mewburn.net (cerberus.mewburn.net [203.217.30.146])
by narn.netbsd.org (Postfix) with ESMTP id 448AB63B11A
for <gnats-bugs@gnats.NetBSD.org>; Fri, 1 Apr 2005 00:17:45 +0000 (UTC)
Message-Id: <20050401001744.9142B2BD09@home.mewburn.net>
Date: Fri, 1 Apr 2005 10:17:44 +1000 (EST)
From: lukem@NetBSD.org
Reply-To: lukem@NetBSD.org
To: gnats-bugs@netbsd.org
Subject: need reentrant API for getpwent_r()
X-Send-Pr-Version: 3.95
>Number: 29850
>Category: lib
>Synopsis: need reentrant API for getpwent_r()
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: lib-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Apr 01 00:18:00 +0000 2005
>Closed-Date: Sat Apr 02 06:15:34 +0000 2005
>Last-Modified: Mon Jul 11 21:23:11 +0000 2005
>Originator: Luke Mewburn
>Release: NetBSD 3.99.1
>Organization:
TNF
>Environment:
>Description:
We currently don't have the reentrant getpwent_r().
See PR 29849 for a similar issue with getgrent_r().
As per the request for getgrent_r(3) in PR 29849,
I propose we adopt the glibc API for getpwent_r(3):
int
getpwent_r(struct passwd *pw, char *buffer, int buflen,
struct passwd **result)
Note that because the compat mode for getpwent(3)
supports "+@netgroup" and "-@netgroup", there are
numerous other reentrancy issues in getpwnam_r()
and getpwuid_r() because of the use of getnetgrent(3)
(et al), and the need to call setpassent(3) as well...
We need to consider how to address these as a
separate issue.
>How-To-Repeat:
Code inspection of getpwent.c.
(Look for "XXXREENTRANT").
>Fix:
Select an appropriate API for getpwent_r().
Implement getpwent_r().
Change getpwent.c::_passwdcompat_pwscan() to use this.
>Release-Note:
>Audit-Trail:
From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/29850 CVS commit: src/lib/libc
Date: Sat, 2 Apr 2005 04:53:53 +0000 (UTC)
Module Name: src
Committed By: christos
Date: Sat Apr 2 04:53:53 UTC 2005
Modified Files:
src/lib/libc: shlib_version
src/lib/libc/gen: getgrent.c getpwent.c
src/lib/libc/include: namespace.h
Log Message:
PR/29849, PR/29850: Add getpwent_r and getgrent_r
To generate a diff of this commit:
cvs rdiff -r1.162 -r1.163 src/lib/libc/shlib_version
cvs rdiff -r1.55 -r1.56 src/lib/libc/gen/getgrent.c
cvs rdiff -r1.66 -r1.67 src/lib/libc/gen/getpwent.c
cvs rdiff -r1.98 -r1.99 src/lib/libc/include/namespace.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: christos@netbsd.org
State-Changed-When: Sat, 02 Apr 2005 01:15:34 -0500
State-Changed-Why:
added
From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/29850 CVS commit: [netbsd-3] src/lib/libc/include
Date: Mon, 11 Jul 2005 21:22:21 +0000 (UTC)
Module Name: src
Committed By: tron
Date: Mon Jul 11 21:22:21 UTC 2005
Modified Files:
src/lib/libc/include [netbsd-3]: namespace.h
Log Message:
Pull up revision 1.99 (requested by lukem in ticket #540):
PR/29849, PR/29850: Add getpwent_r and getgrent_r
To generate a diff of this commit:
cvs rdiff -r1.98 -r1.98.2.1 src/lib/libc/include/namespace.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/29850 CVS commit: [netbsd-3] src/lib/libc/gen
Date: Mon, 11 Jul 2005 21:22:27 +0000 (UTC)
Module Name: src
Committed By: tron
Date: Mon Jul 11 21:22:27 UTC 2005
Modified Files:
src/lib/libc/gen [netbsd-3]: getpwent.c
Log Message:
Pull up revision 1.67 (requested by lukem in ticket #540):
PR/29849, PR/29850: Add getpwent_r and getgrent_r
To generate a diff of this commit:
cvs rdiff -r1.66 -r1.66.2.1 src/lib/libc/gen/getpwent.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/29850 CVS commit: [netbsd-3] src/lib/libc/gen
Date: Mon, 11 Jul 2005 21:22:33 +0000 (UTC)
Module Name: src
Committed By: tron
Date: Mon Jul 11 21:22:33 UTC 2005
Modified Files:
src/lib/libc/gen [netbsd-3]: getgrent.c
Log Message:
Pull up revision 1.56 (requested by lukem in ticket #540):
PR/29849, PR/29850: Add getpwent_r and getgrent_r
To generate a diff of this commit:
cvs rdiff -r1.54.2.1 -r1.54.2.2 src/lib/libc/gen/getgrent.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/29850 CVS commit: [netbsd-3] src/lib/libc
Date: Mon, 11 Jul 2005 21:22:39 +0000 (UTC)
Module Name: src
Committed By: tron
Date: Mon Jul 11 21:22:39 UTC 2005
Modified Files:
src/lib/libc [netbsd-3]: shlib_version
Log Message:
Pull up revision 1.163 (requested by lukem in ticket #540):
PR/29849, PR/29850: Add getpwent_r and getgrent_r
To generate a diff of this commit:
cvs rdiff -r1.161.2.1 -r1.161.2.2 src/lib/libc/shlib_version
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.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.