The man page says:
If the owner or group is specified as -1, then that ID is not
changed.
If user !root says chown("/usr",-1,-1), he gets EPERM. Why?
He explicitly told the kernel that he does not actually want to change
anything. Why would the kernel say EPERM?
Felix
From: Felix von Leitner <[email protected]>
If user !root says chown("/usr",-1,-1), he gets EPERM. Why?
Because the standard says:
The chown( ) function shall fail if:
[EPERM] The effective user ID does not match the owner of the file, or ..
Andries