[linux-cifs-client] Sharing /home with Samba/CIFS

Jeremy Allison jra at samba.org
Wed Oct 22 18:23:29 GMT 2008


On Wed, Oct 22, 2008 at 03:48:56AM -0500, Tom Hansen wrote:
> I would like to use Samba to share the /home directory from one machine to another.  So, I need the following to work:
>
> 1.  In the share, any file created by a user needs to be owned by that user.
> 2.  The system needs to obey the SGID bit for directories, which means:
>    a.  Any file created in a directory with SGID set, will inherit the directory's group ownership.
>    b.  Any directory created in said directory will inherit the group ownership, and also have its SGID bit set.
>
> On the server, I am running Samba 3.0.22 on a 2.6.18.1 kernel.  On the client, mount.cifs reports version 1.10-3.0.28a.
>
> I started by simply mounting the share using mount.cifs as root.  Unix extensions are turned on at the server, so I figured everything would "just work."  Unfortunately, it did not.
>
> The primary problem is that new files created by a user do inherit the group of SGID parent directories, but the owner is always set to root.  This is a slight problem.
>
> I tried setting the "setuids" option on the server, but this simply results in new files always having the user ID and group ID set to the owner, indiscriminately, completely ignoring the SGID bit of the parent directory.
>
> Can I get this to work somehow?
>
> P.S.  Yes, I tried NFS, which is what is normally used for this sort of thing, but unfortunately many of the users belong to more than 16 groups, which breaks NFS3.  NFS4 supposedly solves this, but it doesn't work properly on the 2.6.18.1 kernel that I am stuck with on the server.

3.0.22 is a very old release. The latest current release is 3.2.4.

In that codebase with UNIX extensions enabled, you should be able
to set:

create mask = 07777
security mask = 07777
directory mask = 07777
directory security mask = 07777

and all UNIX permissions should be faithfully
reproduced.

If you do this and it doesn't work on the 3.2.4
version, please log it as a bug at bugzilla.samba.org and
I'll fix it asap.

Thanks,

Jeremy.


More information about the linux-cifs-client mailing list