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

Michael Tokarev mjt at tls.msk.ru
Tue Aug 22 11:45:08 GMT 2000

Robert Dahlem wrote:
> Hi,
> While testing the upgrade from 2.0.6 to 2.0.7 I found some kind of
> misbehaviour of inherit permissions.
> And really: the patch from 2.0.6 to 2.0.7 is:
>  /*******************************************************************
>   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)
>  {
> -  return(mkdir(dos_to_unix(dname,False),mode));
> +  int ret = mkdir(dos_to_unix(dname,False),mode);
> +  if(!ret)
> +    return(dos_chmod(dname,mode));
> +  else
> +    return ret;
>  }


This is a known bug that of Samba Team still can't decide if it is a bug
or not.  I reported this many times, some team members agreed that this is
a bug, but without any further work.   Just remove all the new lines
introduced in 2.0.7 (do this as 2.0.6 did), and you're in buisiness.
This is a crap by gcarter at lanier.com that have over side effects also.

BTW, I just can't realize how many times people should report about
the same thing and how many times should people spend searching
for the same problem to get it fixed in the first place! :(((
Maybe one should start some sort of petition for each bug found,
and the problem will be cured only after some millions of users
will sign that petition ?! :^8

> I'm quite sure this does not do what was intended: the part behind
>         if(!ret)
> gets called when mkdir() does NOT fail, but it should be called when
> mkdir() DOES fail.

Nope, by that bad design chmod should be called only if mkdir succed,
or chmod will fail also.


More information about the samba-technical mailing list