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

Cole, Timothy D. timothy_d_cole at md.northgrum.com
Tue Aug 22 20:57:56 GMT 2000


> -----Original Message-----
> From:	Robert Dahlem [SMTP:Robert.Dahlem at gmx.net]
> Sent:	Tuesday, August 22, 2000 16:36
> To:	Michael Tokarev
> Cc:	samba at samba.org; samba-technical at samba.org
> Subject:	Re: 2.0.7: inherit permissions = yes breaks setting
> read-only on files
> 
> 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;
> }
> 
	I believe non-constant initializers are a GNU C extension.




More information about the samba-technical mailing list