scp bug: newly created dirs do not inherit sgid bit

Bob Proulx bob at proulx.com
Mon Oct 17 05:59:33 EST 2005


Petr Skovron wrote:
> Albert Chin wrote:
> > Petr Skovron wrote:
> > > I discovered that directories created by scp when recursive
> > > copying into a sgid directory do not inherit the sgid bit. I believe
> > > this is a bug. A patch to fix this is attached.
> > 
> > Does rcp do so?
> 
>      The version
> /*      $OpenBSD: rcp.c,v 1.41 2005/03/31 18:39:21 deraadt Exp $        */
> seems to behave the same, with the respective code around lines 677
> (mkdir) and 689 (chmod).

Because rcp was developed on BSD a better question seems to me to be
what is the overall behavior of using rcp on BSD systems?

AFAIK directories always behave as if the sgid bit is set there.  (The
behavior originated there and sgid simulates it on SysV systems.)
Therefore no special handling is needed to get the overall behavior on
BSD systems.

Bob




More information about the openssh-unix-dev mailing list