Bug 6857 - Can't get 'inherit owner' and 'inherit permissions' to work together on FreeBSD
Summary: Can't get 'inherit owner' and 'inherit permissions' to work together on FreeBSD
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.3
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.3.7
Hardware: x64 FreeBSD
: P3 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-29 21:32 UTC by John Waugh
Modified: 2020-03-15 20:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Waugh 2009-10-29 21:32:08 UTC
I am seeing some strange behavior using samba33 (and samba32) on
FreeBSD-7.2_RELEASE.

I have been emailing with another who has an identical samba
configuration (using samba 3.4 instead of my 3.3) on Ubuntu Linux 8.10
equivalent and does not see the problem.

That thread can be viewed here (see the responses from Jeremy Allison)
http://lists.samba.org/archive/samba/2009-August/149946.html

Perhaps I do not understand something about FreeBSD, but it definitely
seems like wrong behavior from samba on this platform.

Here are the details:

I am trying to create a 'dropbox' share, where users can create
files/directories, but cannot edit them once created.
I am using 'inherit owner' on this share, but it is not being respected.

The shared dir looks like:

  drwxrwxr-t  18 nobody  jrw    512 Aug 19 19:11 myshare

The share stanza looks like:

 [myshare]
    path = /whale/shares/myshare
    read only = no
    inherit owner = yes
    inherit permissions = yes
    directory mask = 07775

Yet, when a new directory is created in this shared directory (via
smbclient or from a Windows machine), the newly created dir looks
like:

  drwxrwxr-t   2 jrw jrw    512 Aug 19 19:11 newdir

As you can see, the owner is 'jrw' (the user I log in with), rather
than the parent directory's owner of 'nobody'.
It is the same if I use a non-authenticated share (the owner of the
new dir is the samba guest account, in that case).
Additionally, if I comment out 'inherit permissions' and 'directory
mask', then the owner IS set to 'nobody', but the permissions are
wrong, so that is not useful to me.

It seems like 'inherit owner' is only respected if the directory
permissions are NOT set. But I need them to be set to get the sticky
bit on the newly created directories.

I have tried this on samba3.3 and 3.2, on FreeBSD-7.2_RELEASE (amd64),
on two different machines.

Another person I've talked to had used the exact same samba settings
on Ubuntu  has this working with no problem.

Anyway, let me know if I can do anything to help investigate further.
Comment 1 Björn Jacke 2020-03-15 20:47:00 UTC
this 10y old bug report is not a generic bug I think, it would have popped up more often otherwise.