public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf
@ 2011-02-02 17:03 rstrode at redhat dot com
  2012-12-19 10:51 ` [Bug libc/12459] " schwab@linux-m68k.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: rstrode at redhat dot com @ 2011-02-02 17:03 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12459

           Summary: [RFE] glibc could have a nss_init call that's like
                    res_init but for nsswitch.conf
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: rstrode@redhat.com


Right now, long running processes don't get updates to the nsswitch module list
in /etc/nsswitch.conf if nscd isn't running.  This is because libc caches the
module list in memory after it's initially read.

It would be useful if there was a nss_init() call akin to res_init() that would
flush the cached list and reload it.

A relevant downstream bug report is here:

https://bugzilla.redhat.com/show_bug.cgi?id=621700

In that case the long running process was GDM (graphical login screen).  A user
used authconfig to change their nsswitch.conf and then used fast user switching
(which jumps to a login screen on a different vt) to try to test the new
configuration.  Because the login screen was around before the user ran
authconfig, the list of nsswitch modules was stale.  This caused a getpwnam()
call to fail, which ultimately lead to login failure.

I worked around this for the above bug report by spawning a helper program to
do the getpwnam() call for me.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug libc/12459] [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
@ 2012-12-19 10:51 ` schwab@linux-m68k.org
  2013-10-20 20:31 ` neleai at seznam dot cz
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: schwab@linux-m68k.org @ 2012-12-19 10:51 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=12459

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drepper.fsp at gmail dot    |unassigned at sourceware
                   |com                         |dot org

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug libc/12459] [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
  2012-12-19 10:51 ` [Bug libc/12459] " schwab@linux-m68k.org
@ 2013-10-20 20:31 ` neleai at seznam dot cz
  2014-06-27 13:53 ` fweimer at redhat dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: neleai at seznam dot cz @ 2013-10-20 20:31 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Ondrej Bilka <neleai at seznam dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |neleai at seznam dot cz

--- Comment #1 from Ondrej Bilka <neleai at seznam dot cz> ---
A more reasonable proposition would be add timestamp and reload when more cache
is older than 5 minutes.

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug libc/12459] [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
  2012-12-19 10:51 ` [Bug libc/12459] " schwab@linux-m68k.org
  2013-10-20 20:31 ` neleai at seznam dot cz
@ 2014-06-27 13:53 ` fweimer at redhat dot com
  2015-08-27 21:53 ` [Bug nss/12459] " jsm28 at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 13:53 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug nss/12459] [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
                   ` (2 preceding siblings ...)
  2014-06-27 13:53 ` fweimer at redhat dot com
@ 2015-08-27 21:53 ` jsm28 at gcc dot gnu.org
  2020-07-06 14:10 ` [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf fweimer at redhat dot com
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-08-27 21:53 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libc                        |nss

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
                   ` (3 preceding siblings ...)
  2015-08-27 21:53 ` [Bug nss/12459] " jsm28 at gcc dot gnu.org
@ 2020-07-06 14:10 ` fweimer at redhat dot com
  2020-07-06 14:10 ` fweimer at redhat dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fweimer at redhat dot com @ 2020-07-06 14:10 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Severity|normal                      |enhancement
                 CC|                            |fweimer at redhat dot com
            Summary|[RFE] glibc could have a    |Auto-reloading for
                   |nss_init call that's like   |/etc/nsswitch.conf
                   |res_init but for            |
                   |nsswitch.conf               |
           Assignee|unassigned at sourceware dot org   |dj at redhat dot com

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
Patches for implementing reloading of nsswitch.conf are under review:
https://sourceware.org/pipermail/libc-alpha/2020-July/115678.html

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
                   ` (4 preceding siblings ...)
  2020-07-06 14:10 ` [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf fweimer at redhat dot com
@ 2020-07-06 14:10 ` fweimer at redhat dot com
  2020-07-07 13:32 ` rstrode at redhat dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fweimer at redhat dot com @ 2020-07-06 14:10 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=132608

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
                   ` (5 preceding siblings ...)
  2020-07-06 14:10 ` fweimer at redhat dot com
@ 2020-07-07 13:32 ` rstrode at redhat dot com
  2020-12-16  7:55 ` fweimer at redhat dot com
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rstrode at redhat dot com @ 2020-07-07 13:32 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

--- Comment #4 from Ray Strode [halfline] <rstrode at redhat dot com> ---
great news, thanks!

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
                   ` (6 preceding siblings ...)
  2020-07-07 13:32 ` rstrode at redhat dot com
@ 2020-12-16  7:55 ` fweimer at redhat dot com
  2021-02-17 13:39 ` fweimer at redhat dot com
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fweimer at redhat dot com @ 2020-12-16  7:55 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=27077

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
                   ` (7 preceding siblings ...)
  2020-12-16  7:55 ` fweimer at redhat dot com
@ 2021-02-17 13:39 ` fweimer at redhat dot com
  2021-02-17 13:39 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fweimer at redhat dot com @ 2021-02-17 13:39 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.33
             Status|ASSIGNED                    |RESOLVED

--- Comment #5 from Florian Weimer <fweimer at redhat dot com> ---
This has been implemented in glibc 2.33. Related commits follow. Note that some
fixes are required as well.

commit f4f3b09111e9fa38fd485979a3e40b6cfa6a757d
Author: DJ Delorie <dj@redhat.com>
Date:   Mon Nov 9 22:09:34 2020 -0500

    nsswitch: use new internal API (callers)

    Stitch new ABI and types throughout all NSS callers.

    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

commit 6eceded941bb6dcc097291757e2aef5cd7212133
Author: DJ Delorie <dj@redhat.com>
Date:   Mon Nov 9 22:08:04 2020 -0500

    nsswitch: user new internal API (tests)

    Testsuite support and new test for new API.

    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

commit f8847d83e17774ed5e9c0f75ef693680b91bcae4
Author: DJ Delorie <dj@redhat.com>
Date:   Mon Nov 9 22:06:57 2020 -0500

    nsswitch: use new internal API (core)

    Core changes to switch the NSS internals to use the new API.

    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

commit fa78feca47fdc226b46e7f6fea4c08c10fccd182
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu Feb 20 13:20:32 2020 +0100

    nss: Implement <nss_database.h>

    This code manages the mappings of the available databases in NSS
    (i.e. passwd, hosts, netgroup, etc) with the actions that should
    be taken to do a query on those databases.

    This is the main API between query functions scattered throughout
    glibc and the underlying code (actions, modules, etc).

    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

commit fd5b9b4458ef662d1955459e22a11b15d16a5648
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu Feb 20 09:32:27 2020 +0100

    <nss_action.h>: New abstraction for combining NSS modules and NSS actions

    nss_action manages a set of lists of actions; these are the portions
    of the lines in nsswitch.conf to the right of the colons, like
    "dns [!UNAVAIL=return] files".  Each permutation of actions and
    conditionals is cached for reuse, which limits memory growth, and
    refers to the static list of modules managed by nss_modules.

    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

commit 171689dac7fcb979e7d3ffbd307eacae3c07c2d3
Author: Florian Weimer <fweimer@redhat.com>
Date:   Wed Feb 19 20:55:48 2020 +0100

    nss: Introduce <nss_module.h>

    This provides the struct nss_module type, which combines the old
    struct service_library type with the known_function tree, by
    statically allocating space for all function pointers.

    struct nss_module is fairly large (536 bytes), but it will be
    shared across NSS databases.  The old known_function handling
    had non-some per-function overhead (at least 32 bytes per looked-up
    function, but more for long function anmes), so overall, this is not
    too bad.  Resolving all functions at load time simplifies locking,
    and the repeated lookups should be fast because the caches are hot
    at this point.

    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
                   ` (8 preceding siblings ...)
  2021-02-17 13:39 ` fweimer at redhat dot com
@ 2021-02-17 13:39 ` fweimer at redhat dot com
  2021-06-07 12:28 ` fweimer at redhat dot com
  2024-05-22 23:11 ` m.novosyolov at rosalinux dot ru
  11 siblings, 0 replies; 13+ messages in thread
From: fweimer at redhat dot com @ 2021-02-17 13:39 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|22041                       |


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=22041
[Bug 22041] NSS persistently caches transient dlopen errors
-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
                   ` (9 preceding siblings ...)
  2021-02-17 13:39 ` fweimer at redhat dot com
@ 2021-06-07 12:28 ` fweimer at redhat dot com
  2024-05-22 23:11 ` m.novosyolov at rosalinux dot ru
  11 siblings, 0 replies; 13+ messages in thread
From: fweimer at redhat dot com @ 2021-06-07 12:28 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=27959

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf
  2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
                   ` (10 preceding siblings ...)
  2021-06-07 12:28 ` fweimer at redhat dot com
@ 2024-05-22 23:11 ` m.novosyolov at rosalinux dot ru
  11 siblings, 0 replies; 13+ messages in thread
From: m.novosyolov at rosalinux dot ru @ 2024-05-22 23:11 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=12459

Mikhail Novosyolov <m.novosyolov at rosalinux dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m.novosyolov at rosalinux dot ru

--- Comment #6 from Mikhail Novosyolov <m.novosyolov at rosalinux dot ru> ---
Seems that this caching intorduced a memory leak:
https://sourceware.org/bugzilla/show_bug.cgi?id=31791

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-05-22 23:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 17:03 [Bug libc/12459] New: [RFE] glibc could have a nss_init call that's like res_init but for nsswitch.conf rstrode at redhat dot com
2012-12-19 10:51 ` [Bug libc/12459] " schwab@linux-m68k.org
2013-10-20 20:31 ` neleai at seznam dot cz
2014-06-27 13:53 ` fweimer at redhat dot com
2015-08-27 21:53 ` [Bug nss/12459] " jsm28 at gcc dot gnu.org
2020-07-06 14:10 ` [Bug nss/12459] Auto-reloading for /etc/nsswitch.conf fweimer at redhat dot com
2020-07-06 14:10 ` fweimer at redhat dot com
2020-07-07 13:32 ` rstrode at redhat dot com
2020-12-16  7:55 ` fweimer at redhat dot com
2021-02-17 13:39 ` fweimer at redhat dot com
2021-02-17 13:39 ` fweimer at redhat dot com
2021-06-07 12:28 ` fweimer at redhat dot com
2024-05-22 23:11 ` m.novosyolov at rosalinux dot ru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).