chown silently fails to respect NSS

Chris Stankevitz chrisstankevitz at gmail.com
Tue Jun 23 18:43:14 UTC 2015


Hi,

Why is chown is silently failing to chown a file to a winbind user
that is listed in 'getent passwd'?  I can chown to other users on the
system.  I can also chown to arbitrary numbers as long as they do not
match those from winbind.

My guess: "uid == (uid_t)-1" which causes chown to silently fail.
Perhaps getpwnam doesn't work with NSS?

Thank you,

Chris

===

root at zinc:~/temp # ls -l
total 0

root at zinc:~/temp # pwd
/root/temp

root at zinc:~/temp # getent passwd MYDOMAIN\\cstankevitz
MYDOMAIN\cstankevitz:*:4294967295:4294967295:Chris
Stankevitz:/home/MYDOMAIN/cstankevitz:/bin/false

root at zinc:~/temp # touch file.txt

root at zinc:~/temp # ls -l
total 1
-rw-r--r--  1 root  wheel  0 Jun 23 11:34 file.txt

root at zinc:~/temp # chown -v -v MYDOMAIN\\cstankevitz file.txt

root at zinc:~/temp # ls -l
total 1
-rw-r--r--  1 root  wheel  0 Jun 23 11:34 file.txt


More information about the freebsd-questions mailing list