2.0.7: inherit permissions = yes breaks setting read-only on files

Robert Dahlem Robert.Dahlem at gmx.net
Tue Aug 22 20:35:46 GMT 2000


Michael,

On Tue, 22 Aug 2000 20:37:59 +0400, Michael Tokarev wrote:

>BTW, this will be better written as (just polishing,
>same logic):
>
>int dos_mkdir(char *dname,mode_t mode)
>{
>  int ret = mkdir(dos_to_unix(dname,False),mode);
>#ifdef HAVE_BROKEN_MKDIR
>  SMB_STRUCT_STAT sbuf;
>  if(!ret && !dos_stat(dname,&sbuf) && mode & ~sbuf.st_mode)
>    dos_chmod(dname,sbuf.st_mode | mode & ~sbuf.st_mode);
>#endif
>  return ret;
>}
>
>(note that sbuf will be unused in your case if !HAVE_BROKEN_MKDIR).

It won't compile (at least on my system). It needs some additional 
curly braces.

int dos_mkdir(char *dname,mode_t mode)
{
  int ret = mkdir(dos_to_unix(dname,False),mode);
#ifdef HAVE_BROKEN_MKDIR
  {
    SMB_STRUCT_STAT sbuf;
    if(!ret && !dos_stat(dname,&sbuf) && mode & ~sbuf.st_mode)
      dos_chmod(dname,sbuf.st_mode | mode & ~sbuf.st_mode);
  }
#endif
  return ret;
}

Ok, now that we've come so far: Anybody from the Samba team listening? 

Is there any way this will make its way into the production code?

Is there anybody who can make an autoconf test for HAVE_BROKEN_MKDIR ?

Regards,
        Robert


-- 
---------------------------------------------------------------
Robert.Dahlem at gmx.net           Fax +49-69-432647
---------------------------------------------------------------




More information about the samba mailing list