Bug 165527 - [libc] [patch] setgroupent() does not make file descrptors opened
Summary: [libc] [patch] setgroupent() does not make file descrptors opened
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-28 11:50 UTC by Andrey Simonenko
Modified: 2021-02-20 16:37 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (612 bytes, patch)
2012-02-28 11:50 UTC, Andrey Simonenko
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Simonenko 2012-02-28 11:50:08 UTC
If the setgroupent() library function is called with non-zero argument,
then file descriptors used for accessing databases should be left opened.
Actually this does not work and reduce performance.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:31 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-01-21 19:31:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=48a186863431ec7a23c6174bc376cafa59dd5fbf

commit 48a186863431ec7a23c6174bc376cafa59dd5fbf
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-01-21 19:30:19 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-01-21 19:30:19 +0000

    libc/nss: Ensure that setgroupent(3) actually works as advertised

    Because the "files" and "compat" implementations failed to set the
    "stayopen", keyed lookups would close the database handle, contrary to
    the purpose of setgroupent(3).  setpassent(3)'s implementation does not
    have this bug.

    PR:             165527
    Submitted by:   Andrey Simonenko
    MFC after:      1 month

 lib/libc/gen/getgrent.c | 2 ++
 1 file changed, 2 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-02-20 16:37:07 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a46d7192f41aa977a49bb3aae2947131186878ca

commit a46d7192f41aa977a49bb3aae2947131186878ca
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-01-21 19:30:19 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-02-20 16:35:32 +0000

    libc/nss: Ensure that setgroupent(3) actually works as advertised

    Because the "files" and "compat" implementations failed to set the
    "stayopen", keyed lookups would close the database handle, contrary to
    the purpose of setgroupent(3).  setpassent(3)'s implementation does not
    have this bug.

    PR:             165527
    Submitted by:   Andrey Simonenko

    (cherry picked from commit 48a186863431ec7a23c6174bc376cafa59dd5fbf)

 lib/libc/gen/getgrent.c | 2 ++
 1 file changed, 2 insertions(+)