From: Derek Simkowiak on
Hello,
I'm trying to export a /home/ partition for multiple users, using
Samba and the setuids option. My goal is to deliver emails into
$HOME/.Maildir/ for each user. So I mount the share as user "root",
hoping that each user will be able to use their own home directory (just
like an NFS /home/ mount). (This feature depends on the Unix extensions.)

I have the following share configured in smb.conf:

[testhome]
comment = Root-mounted Home Dir
browseable = no
writable = yes
valid user = root
path = /home

I can mount it using these options in /etc/fstab... note the use of
"setuids" here:

//cst6/testhome /testhome cifs
iocharset=utf8,credentials=/root/cst6_password.txt,setuids 0 0

But setuids seems to be broken, either in the server, or in the
client, or both.

With an Ubuntu 9.10 or 10.4 client (Samba 3.4.0 or 3.4.7), it's
completely broke. If I try to create a file as a regular user, it does
create the file (as root) but then fails when it goes to set the
ownership. Note the "Permission denied" error below, after the file was
successfully created:

root(a)cst5:/testhome# mkdir test
root(a)cst5:/testhome# chmod 777 test
root(a)cst5:/testhome# su - ubuntu
ubuntu(a)cst5:~$ cd /testhome/test/
ubuntu(a)cst5:/testhome/test$ touch file_test1.txt
touch: cannot touch `file_test1.txt': Permission denied
ubuntu(a)cst5:/testhome/test$ mkdir dir_test1.d
ubuntu(a)cst5:/testhome/test$ ls -la
total 0
drwxrwxrwx 3 root root 0 2010-05-28 12:58 .
drwxr-xr-x 7 root root 0 2010-05-28 12:57 ..
drwxr-xr-x 2 root root 0 2010-05-28 12:58 dir_test1.d
-rw-r--r-- 1 root root 0 2010-05-28 12:58 file_test1.txt
ubuntu(a)cst5:/testhome/test$

The "Permission denied" error indicates that it is trying to set the
UID, but failing.

But using an ebox client (Samba 3.4.5), it *almost* works.
Newly-created files have the correct UID, but new directories are still
owned by root (with no error message printed):

root(a)ebox:/testhome# mkdir test
root(a)ebox:/testhome# chmod 777 test
root(a)ebox:/testhome# su - ubuntu
ubuntu(a)ebox:~$ cd /testhome/test
ubuntu(a)ebox:/testhome/test$ touch file_test1.txt
ubuntu(a)ebox:/testhome/test$ mkdir dir_test1.d
ubuntu(a)ebox:/testhome/test$ ls -la
total 0
drwxrwxrwx 3 root root 0 2010-05-28 12:51 .
drwxr-xr-x 7 root root 0 2010-05-28 12:50 ..
drwxr-xr-x 2 root root 0 2010-05-28 12:51 dir_test1.d
-rw-r--r-- 1 ubuntu ubuntu 0 2010-05-28 12:50 file_test1.txt
ubuntu(a)ebox:/testhome/test$

Based on this testing, it looks like setuids works for files, but
only for Samba client 3.4.5. Using setuids for directories fails
completely. Since there is no error message printed, it looks like the
client is not even trying to set the directory UID.

These results are the same regardless of the Samba server version.
I tried it with an Ubuntu 9.10 server (Samba 3.4.0) and Ubuntu 10.4
server (Samba 3.4.7). All the pre-existing UIDs and GIDs seem to be
recognized correctly on the share, so I think the Unix extensions are
working correctly.

Is there anything else I can try? Looking at this earlier post, it
seems like maybe "setuids" is not even a supported option anymore...?

http://lists.samba.org/archive/linux-cifs-client/2010-March/005600.html


Thanks,
Derek

--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba