BUG with g+s: Re: "Inherit Permissions" request for comments

Michael Tokarev mjt at tls.msk.ru
Mon Jun 5 09:21:33 GMT 2000


Just noticied that changes around "inherit permissions"
in 2.0.7 takes off the ability to use unix g+s bit on
directories.  I don't know if it is related to this parameter.
Here it is (lib/doscalls.c):

/*******************************************************************
 Mkdir() that calls dos_to_unix.
 Cope with UNIXes that don't allow high order mode bits on mkdir.
 Patch from gcarter at lanier.com.
********************************************************************/

int dos_mkdir(char *dname,mode_t mode)
{
  int ret = mkdir(dos_to_unix(dname,False),mode);
  if(!ret)
    return(dos_chmod(dname,mode));
  else
    return ret;
}

Here, samba efficiently clears the g+s bit implicitly set by unix,
by the chmod() call:

  mkdir(path, 0755) will create dir with rwxr-sr-x
  chmod(path, 0755) will reset mode to   rwxr-xr-x

I don't know why gcarter at lanier.com made this, but this definitely
broke things.

So, for current samba version (2.0.7), inherit permissions is only one thing
one could use for g+s....  Nice thing, isnt't it?!

Regards,
  Michael.


More information about the samba-technical mailing list