Subject: su chdirs to home as root
To: None <current-users@netbsd.org>
From: Arto Huusko <arto.huusko@pp2.inet.fi>
List: current-users
Date: 10/19/2007 09:51:09
hi,

in a situation with a local user and a NIS user with home on NFS,
I'm getting:

su: no directory: permission denied

when doing "su -" from local user to NIS user. (I changed the
errx("no directory") in su_pam.c to err() to get the errno.)

I can login locally as the NIS user without any problems.

Further debugging shows that su does the chdir to home directory
as root (getuid() and geteuid() returned 0). This is a problem when
the NFS  server is configured so that client root is treated as nobody
on the server. And this is the case here:

# cd /home/user
cd: can't cd to /home/user