> Andrew> Is this behaviour deliberate, or a bug? The chown binary
> Andrew> from gnu coreutils does not do this.
> You don't say what platform you are running on, but "man 2 chown" on
> my RH8 box says (in part):
> When the owner or group of an executable file are changed by a
> super-user, the S_ISUID and S_ISGID mode bits are cleared. POSIX
> not specify whether this also should happen when root does the
> the Linux behaviour depends on the kernel version. In case of a
> group-executable file (with clear S_IXGRP bit) the S_ISGID bit
> cates mandatory locking, and is not cleared by a chown.
> so Ruby is just doing what the system call does.
Thanks Daniel. This not only answers my question, but brings to my notice
the mysterious lack of man2 manual pages on my system ;)

I guess /bin/chown must explicitly save the permissions then reset them
after the call to chown()


Andrew Walrond