All of lore.kernel.org
 help / color / mirror / Atom feed
* chown: s-Bits: to clear or not to clear
@ 2013-07-16  8:29 Ulrich Windl
  0 siblings, 0 replies; only message in thread
From: Ulrich Windl @ 2013-07-16  8:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ulrich Windl

Hi folks,

I discovered (SLES11 SP2 with kernel  3.0.80) that a chown executed by root (from non-root to non-root user) clears any s-Bits that were set for the old owner.

The man page (man 2 chown) says:
       When  the  owner  or  group of an executable file are changed by a non-
       superuser, the S_ISUID and S_ISGID mode bits are cleared.   POSIX  does
       not specify whether this also should happen when root does the chown();
       the Linux behavior depends on the kernel version.  In case  of  a  non-
       group-executable  file (i.e., one for which the S_IXGRP bit is not set)
       the S_ISGID bit indicates mandatory locking, and is not  cleared  by  a
       chown().

As there are good arguments for and against clearing the s-Bits during chown, there are probably only good arguments for having an option for chown(1) to preserve the s-Bits. What do you think? (I know this is the wrong list for discussing utils).

Regards,
Ulrich Windl



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-16  8:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-16  8:29 chown: s-Bits: to clear or not to clear Ulrich Windl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.