tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: UFS and POSIX test suite

On Mon, Jan 02, 2012 at 01:37:23AM +0400, Valeriy E. Ushakov wrote:
> > It seems to me that either behaviour complies with the language
> > that you quote:
> > 
> >     If the calling process does not have appropriate privileges,
> >     and if the group ID of the file does not match the effective
> >     group ID or one of the supplementary group IDs and if the
> >     file is a regular file, bit S_ISGID (set-group-ID on
> >     execution) in the file's mode will be cleared upon successful
> >     return from chmod().
> > 
>   [EPERM]
>     The effective user ID does not match the owner of the file and the
>     process does not have appropriate privileges.
> The quoted passage about S_ISGID seems to tell that if user does own
> the file (cf. "successful return from chmod()") but there is gid
> mismatch, then S_ISGID in "mode" is silently ignored if present and is
> also "cleared ...  in the file's mode" - but chmod() still succeeds.

Hmmmm.... It seems a little strange that a request to set the file
modes to their current values has the effect of clearing the S_ISGID bit!
It would even make sense to allow the removal of other bits without
S_ISGID being cleared - but you don't want to allow write access to
be gained on such files.


David Laight:

Home | Main Index | Thread Index | Old Index