Setting Directory permissions from NT

Michael Tokarev mjt at tls.msk.ru
Mon Aug 7 19:48:44 GMT 2000


"C. J. Keist" wrote:
> 
> Hello,
>     I have samba 2.0.7-4 installed on RH 6.2. Anyway, we are able to change
> permission on files from NT, but it will not change the permission on
> directories.

Dunno...

>              Also, when the directory has the SGID bit on (e.g. chmod
> 2775), it shows the group as being the owner instead of the actual
> owner. Is there something I'm missing in the smb.conf file?  Or does this
> sound like a bug?

This _is_ a bug.  To cure it, open source/lib/doscalls.c file and replace:

----- this things -----
/*******************************************************************
 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;
}
-----------
------ to this things ---------
/*******************************************************************
 Mkdir() that calls dos_to_unix.
 Patch from gcarter at lanier.com -- back it.  It not work.
********************************************************************/

int dos_mkdir(char *dname,mode_t mode)
{
  return mkdir(dos_to_unix(dname,False),mode);
}


Regards,
 Michael.




More information about the samba-technical mailing list