[Bug 230937] nfsuserd - missing endpwent() and endgrent() before daemon() & fork()

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Aug 27 13:58:06 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230937

            Bug ID: 230937
           Summary: nfsuserd - missing endpwent() and endgrent() before
                    daemon() & fork()
           Product: Base System
           Version: 11.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: peter at ifm.liu.se

Created attachment 196598
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=196598&action=edit
Patch to /usr/src/usr.sbin/nfsuserd/nfsuserd.c

We are using a (own developed) DB based backend for nsswitch in order to
improve speed for our file servers. After upgrading to 11.2 we noticed that we
had problems on one of them in that initially on a newly booted server NFS
clients correctly saw user & group names but then after a short while the
client started reporting "nobody" instead.

Investigating this issue it seemed to be connected to the cache timeout as
specified for the nfsuserd daemon (we used 10 minutes). Any uid -> name or gid
-> name lookups after the timeout limit would just return "nobody".

Looking at the source code for nfsuserd.c I noticed missing endpwent() and
endgrent() calls during the initial cache priming of users & groups and before
the slave workers processes were forked off, and adding those made this work
nicely again. 

Please find enclosed a (very) simple patch that adds those missing calls.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list