I am trying to chown a file, and I am getting a Not owner
message
bash-3.00$ uname -a
SunOS host001 5.10 Generic_138888-03 sun4u sparc SUNW,SPARC-Enterprise
bash-3.00$ id
uid=60010(user1) gid=910(web)
bash-3.00$ ls -l file.ext
-rwxrwxrwx 1 user1 web 17449 Feb 14 10:53 file.ext
bash-3.00$ chown user2 file.ext
chown: file.ext: Not owner
How could I detect if this machine has restricted chown usage?
getconf _POSIX_CHOWN_RESTRICTED /
checks the setting on the/
directory, POSIX allows different paths to have different values, such as local filesystems vs. NFS, hence the requirement to include a path to the directory or file you want to know about.As root:
If this returns "rstchown: 1", then you cannot chown unless root. You can add:
to
/etc/system
to change this behavior.