mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
nfsuserd.c: Fix handling where pw_name/gr_name differ from lookup name
When an NSS backend returns a canonical pw_name or gr_name that differs from the lookup name supplied by the NFSv4 upcall, nfsuserd stores the successful mapping in the kernel cache under the canonical name instead of the requested name. This causes the retry lookup performed by nfsv4_strtouid() or nfsv4_strtogid() to miss the newly inserted cache entry, resulting in the default UID/GID being returned although the NSS lookup itself succeeded. PR: 296753 Reviewed by: rmacklem Tested by: Emanuel Helms <[email protected]> MFC after: 2 weeks
This commit is contained in:
1 parent
8ffe2419e4
commit
1771ab245c
1 file changed
+4
-2
@@ -704,7 +704,8 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXPRT *transp)
|
||||
if (pwd != NULL) {
|
||||
nid.nid_usertimeout = defusertimeout;
|
||||
nid.nid_uid = pwd->pw_uid;
|
||||
nid.nid_name = pwd->pw_name;
|
||||
/* NSS may canonicalize the name used for the lookup. */
|
||||
nid.nid_name = info.name;
|
||||
} else {
|
||||
nid.nid_usertimeout = 5;
|
||||
nid.nid_uid = defaultuid;
|
||||
@@ -737,7 +738,8 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXPRT *transp)
|
||||
if (grp != NULL) {
|
||||
nid.nid_usertimeout = defusertimeout;
|
||||
nid.nid_gid = grp->gr_gid;
|
||||
nid.nid_name = grp->gr_name;
|
||||
/* NSS may canonicalize the name used for the lookup. */
|
||||
nid.nid_name = info.name;
|
||||
} else {
|
||||
nid.nid_usertimeout = 5;
|
||||
nid.nid_gid = defaultgid;
|
||||
|
||||
Reference in new issue
Block a user