[Samba] Strange permission problem when mounting a share

September 04th, 2011 - 12:20 am ET by Fabrice | Report spam
Hello all,

I have been struggling with a permission issue with Samba for over a week
now. I've tried many different setup, without much success.

I am using samba 3.6 on Arch Linux. The user I am testing with is a member
of the group nobody.
I have a share defined as it :

security = share

[public]
path = /home/smbshare
public = yes
only guest = yes
writable = yes
printable = no
create mask = 0775
force create mode = 0775

The permissions on my *smbshare* folder (and the files within) are :

drwxrwsr-x 10 nobody nobody 4096 Jun 5 17:35 smbshare

When I am using Dolphin (KDE) to browse my share, everything is working as
expected. I do not have to enter a pwd and I can create, rename, delete
without any problems.
For instance if I go to :

smb://127.0.0.1/public/Pictures/

And create a file with Dolphin, the permissions are exactly what I want :

-rwxrwxr-x 1 nobody nobody 2 May 20 16:33 test-dolphin.txt

Now, I want to *mount the folder in my user home directory.* I am not using
Dophin anymore, I do everything from the terminal.

$ sudo mount -t cifs //127.0.0.1/public/Pictures /home/myuser/Pictures/
$ cd Pictures/
$ touch test-konsole.txt
touch: cannot touch `test-konsole.txt': Permission denied

*But the file is created anyway*... with the incorrect permissions
(rwxr-xr-x instead of rwxrwxr-x)

-rwxr-xr-x 1 nobody nobody 0 Aug 28 19:01 test-konsole.txt

So what am I missing here ? Could it be related to this problem ?

https://bugzilla.samba.org/show_bug.cgi?id€61


Thanks!
**
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
email Follow the discussionReplies 2 repliesReplies Make a reply

Replies

#1 TAKAHASHI Motonobu
September 04th, 2011 - 04:30 am ET | Report spam
2011/9/4 Fabrice :
Now, I want to *mount the folder in my user home directory.* I am not using
Dophin anymore, I do everything from the terminal.

$ sudo mount -t cifs //127.0.0.1/public/Pictures /home/myuser/Pictures/
$ cd Pictures/
$ touch test-konsole.txt
touch: cannot touch `test-konsole.txt': Permission denied

*But the file is created anyway*... with the incorrect permissions
(rwxr-xr-x instead of rwxrwxr-x)

-rwxr-xr-x  1 nobody  nobody         0 Aug 28 19:01 test-konsole.txt

 So what am I missing here ? Could it be related to this problem ?



Unlike NFS,
you have to notice that permission of the mounted directory is not inherited
from those of the mouting directory's but is set with dir_mode and file_mode
option because CIFS can not treat "permission" basically.

Try:

$ sudo mount -t cifs -o rw,noperm //127.0.0.1/public/Pictures
/home/myuser/Pictures/

OR

$ sudo mount -t cifs -o rw,file_mode66,dir_mode77
//127.0.0.1/public/Pictures /home/myuser/Pictures/

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

Similar topics