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

Robert Dahlem Robert.Dahlem at gmx.net
Tue Aug 22 22:48:54 GMT 2000


Timothy,

On Tue, 22 Aug 2000 16:57:56 -0400, Cole, Timothy D. wrote:

>> >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

>> It won't compile (at least on my system). It needs some additional 
>> curly braces.
>>
>>   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

>	I believe non-constant initializers are a GNU C extension.

Its ok on non-GNU C compilers too.

The problem is the declaration ("SMB_STRUCT_STAT sbuf") behind non-declarative 
code ("mkdir(dos_to_unix(dname,False),mode)"). This demands a new block.

Regards,
        Robert

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






More information about the samba-technical mailing list