2001-03-05 19:06:28

by Felix von Leitner

[permalink] [raw]
Subject: chown bug

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


2001-03-05 20:05:53

by Andries E. Brouwer

[permalink] [raw]
Subject: Re: chown bug

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