Bill Caroselli <firstname.lastname@example.org
Steve Reid <email@example.com
SR > Bill Caroselli <firstname.lastname@example.org
All the halpviewer page says is that:
The chgrp utility can fail if you don't have appropriate permissions.
SR > I think you have to be root or the owner of the file
That is correct. Owner or root (what POSIX refers to as implementation-
defined "appropriate privileges"
There is also the concept of
CHOWN_RESTRICTED, which affects this too, and fs-qnx4 sets that attribute
(assuming you are hosted on a disk filesystem, it will be different for
each underlying filesystem manager) which further limits this.
I think if I have write permission to the parent directory I should
have permission to change the owner, group, mods, etc of anything in
The POSIX standard disagrees with you :-/
And, in their Rationale (B.5.6.5) they say: "System V allows a user to
give away files; that is, the owner of a file may change its user ID
to anything. This is a serious problem for implemenations that are
intended to meet government security regulations.".
Note that I CAN remove the directory as a non-owner but group member.
I would think that a chgrp is much less destructive than a delete.
POSIX only requires write permission on the parent dir to do this (so
owner/group IDs are irrelevant). We do support the UNIX "sticky"
bit on a directory, which also requires file ownership to unlink
(eg "chmod +t /tmp" in a shared environment is useful).
Can someoen check the POSIX specs?
Looks like we conform to me. The spec starts "Only processes with
an effective user ID equal to the user ID of the file or with
appropriate privileges may change the ownership ..." and just gets
more strict (via _POSIX_CHOWN_RESTRICTED) from there
filesystems set that attribute, so are the strict end of the standard.