Re: [PATCH 1/3] cifs.upcall: fix regression with krb5 + creduid
Paulo Alcantara <[email protected]>
| Newsgroups | org.kernel.vger.linux-cifs |
|---|---|
| Message-ID | <[email protected]> |
Enzo Matsumiya <[email protected]> writes: > With 'mount.cifs -o sec=krb5,cruid=XXX' (where XXX > 0), get_uidgid() > maps XXX to 0, as mount.cifs is running as root. > > This makes kerberos lookup for credentials for UID 0, which, if not > existent, will fail with -ENOKEY. > > To fix this, simply ignore UID/GID mapping (get_uidgid() call) when > arg->uid == 0, as cifs.upcall is already running as root anyway, and > then kerberos will use 'uid' (which might be 0 or cruid) for lookup. > > Fixes: 972c5b5ff95e ("cifs.upcall: remove getpwuid() dependency") > Reported-by: Paulo Alcantara <[email protected]> > Signed-off-by: Enzo Matsumiya <[email protected]> > --- > cifs.upcall.c | 30 +++++++++++++++++++++--------- > 1 file changed, 21 insertions(+), 9 deletions(-) Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]>