[Bug nss/24695] New: nss_db: calling getpwent after endpwent crashes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug nss/24695] New: nss_db: calling getpwent after endpwent crashes

Martin.Jansa at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24695

            Bug ID: 24695
           Summary: nss_db: calling getpwent after endpwent crashes
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nss
          Assignee: unassigned at sourceware dot org
          Reporter: dj at redhat dot com
  Target Milestone: ---

If you omit the setpwent() call, getpwent() works correctly - until you call
endpwent(), after which further calls to getpwent() segfault instead of
restarting the scan.

Reproducible with "passwd: db ..." in /etc/nsswitch.conf

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug nss/24695] nss_db: calling getpwent after endpwent crashes

Martin.Jansa at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24695

dj at redhat dot com <dj at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |dj at redhat dot com

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug nss/24695] nss_db: calling getpwent after endpwent crashes

Martin.Jansa at gmail dot com
In reply to this post by Martin.Jansa at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24695

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by DJ Delorie <[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=99135114ba23c3110b7e4e650fabdc5e639746b7

commit 99135114ba23c3110b7e4e650fabdc5e639746b7
Author: DJ Delorie <[hidden email]>
Date:   Fri Jun 28 18:30:00 2019 -0500

    nss_db: fix endent wrt NULL mappings [BZ #24695] [BZ #24696]

    nss_db allows for getpwent et al to be called without a set*ent,
    but it only works once.  After the last get*ent a set*ent is
    required to restart, because the end*ent did not properly reset
    the module.  Resetting it to NULL allows for a proper restart.

    If the database doesn't exist, however, end*ent erroniously called
    munmap which set errno.

    The test case runs "makedb" inside the testroot, so needs selinux
    DSOs installed.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug nss/24695] nss_db: calling getpwent after endpwent crashes

Martin.Jansa at gmail dot com
In reply to this post by Martin.Jansa at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24695

dj at redhat dot com <dj at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.30

--- Comment #2 from dj at redhat dot com <dj at redhat dot com> ---
Fix committed.

--
You are receiving this mail because:
You are on the CC list for the bug.