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

Jeremy Allison jra at samba.org
Tue Aug 18 16:11:44 MDT 2009


On Mon, Aug 17, 2009 at 10:48:04PM -0700, jw wrote:
> Hello
> I am trying to create a 'dropbox' share, using the sticky bit and
> 'inherit owner'.
> 
> By themselves they work, but when a directory is created in this
> share, its permissions are not quite what I need.
> Therefore, I try to use 'force directory mode' or 'inherit permissions'.
> However, whenever I do that, the owner on the newly-created directory
> is no longer correct w/regard to 'inherit owner'.
> 
> Is this correct behavior, or a bug?
> 
> Here are details:
> 
> The directory I'm sharing:
>    drwsrwsr-t  2 nobody  sambaguest   512 Aug 17 22:18 myshare
> 
> My smb.config (well, the relevant part):
> 
> # ... snip
>   guest account = sambaguest
> # ... snip
> [myshare]
>  comment = my share
>  path = /path/to/myshare
>  public = yes
>  read only = no
>  writable = yes
>  browseable = yes
>  printable = no
>  inherit owner = yes
>  #inherit permissions = yes
>  #directory mode = 3770
>  #force directory mode = 3770
> 
> As it is written above, when I create a directory from a windows box
> it looks like:
> 
>    drwxr-xr-x  2 nobody  sambaguest  512 Aug 17 22:19 New Folder
> 
> Correct ownership but I want group write and the sticky bit to be set,
> as in the parent directory.

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.

Jeremy.


More information about the samba mailing list