[Samba] 'inherit owner' doesn't play nice with 'force directory mode'

jw jwdevel at gmail.com
Tue Aug 18 21:09:00 MDT 2009


On Tue, Aug 18, 2009 at 3:11 PM, Jeremy Allison<jra at samba.org> wrote:
> To allow these to apply to the new directory, set :
>
> directory mask = 0775
>
> The reason you're not getting 775 perms on the new directory
> is that the default directory mask is 0755, which masks out
> the write permission for the group.
>
> Just setting inherit owner, and directory mask = 0775
> should be enough.

Hi,

I gave this a shot, but it's still not quite doing what I would expect.
I have:

   inherit owner = yes
   directory mask = 7775

And this produces:

   drwxrwxr-x   2 nobody      sambaguest   512 Aug 18 19:54 New Folder (20)

The problem is the sticky bit is not set. I want the sticky bit to be
set so that new files created under this directory cannot be edited
once created.

I tried various permutations of 'directory mask', 'force user' (thanks
Liutauras), 'directory mode' and 'force directory mode', and it seems
to be the case that whenever I get the correct user, the sticky bit is
not set, and vice-versa. This seems to be independent of the other
directory permissions...

For instance, I now have this config:

   inherit owner = yes
   #force user = nobody
   directory mode = 7777
   force directory mode = 3770
   directory mask = 7777

And a new directory looks like:

   drwxrwsrwt   2 sambaguest  sambaguest   512 Aug 18 20:05 New Folder (26)

Correct sticky bit, wrong owner.

Then I toggle the commented 'force user' line, and I get:

   drwxrwxrwx   2 nobody      sambaguest   512 Aug 18 20:05 New Folder (27)

Correct owner, but no sticky bit.

Any more thoughts?
Thanks everyone for looking at this

-John


More information about the samba mailing list