Detect if Solaris has chown restricted

chownsolaris

I am trying to chown a file, and I am getting a Not ownermessage

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?

Best Answer

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.

Related Topic