tech-kern archive

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

Re: UFS and POSIX test suite



On Sun, Jan 01, 2012 at 07:05:06PM +0100, Emmanuel Dreyfus wrote:
>

> I intentend to use it to hunt bugs for NetBSD FUSE. Without any
> surprise, there are a lot of failures, but I am a it surprised to see
> that NetBSD UFS fails the same tests most of the time.
> 
> To give an exaample, the script detects that when an unprivilegied user
> attempts to set the setGID bit, it should be cleared, while NetBSD UFS
> returns EPERM.
> 
> And just clearing the bit indeed seems to be mandated by POSIX:
>  http://pubs.opengroup.org/onlinepubs/7908799/xsh/chmod.html)
> 
> Opinions? Do we have bugs to fix here? Anyone already gave it a try?

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().

This does not specify that the call to chmod(2) return success if
an unprivileged user attempts to set the setGID but it does specify
that if success is returned then the bit should be cleared, if I
am reading it correctly.  This seems to indicate that both behaviours
are valid.

--
    Roland Dowdeswell                      http://Imrryr.ORG/~elric/


Home | Main Index | Thread Index | Old Index