This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/219] New: invalid __libc_dlclose() in nsswitch.c


Hi,

This bug was originally reported here:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=222130

The problem occurs at program shutdown when there is an invalid lookup
method in /etc/nsswitch.conf and the program has tried to use that
method.

Debian by default installs a /etc/nsswith.conf that looks like:

protocols:      db files

On at least a stable and a testing system here the 'db' lookup method
does not have a corresponding library (there is no libnss_db* on the
system). If you want to ensure that you see the bug, just add an 
invalid lookup method to the front of the list:

protocols:      invalid_method db files

The patch fixes the problem by not trying to close an invalid
library handle.  It took some reading to see why we check for -1 and
not NULL.  If __nss_lookup_function() fails to open a lookup method it
found in /etc/nsswitch.conf it marks the handle as -1 at line 354 of
nsswitch.c.  The -1 is used so that the next time through it doesn't
waste resources looking for a method that isn't available.  NULL is
used only for libraries that might exist (__nss_lookup_function()
hasn't yet looked for those libraries).

Thanks for all the good work,

David

-- 
           Summary: invalid __libc_dlclose() in nsswitch.c
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: kimdon at esrf dot fr
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://sources.redhat.com/bugzilla/show_bug.cgi?id=219

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]