PDA

View Full Version : Samba and default chmod


psunix
December 8th, 2008, 11:56
Hi

This is my first post here and I think it's great that the freebsd project now got it's own forum.

I got a strange problem with samba and the default chmod only with one specific share.

my sbm.conf
[global]
...
# default create mode
create mode = 0770
directory mode = 0770
...
# shares
[it]
path = /mnt/data1/share/it
writeable = yes
...

Now the problem is, if any user saves a new file on this share the permission is set to 0700.
And I really don't know why, because on all other shares the permission is correctly set to 0770 as defined in my smb.conf.

I also checked the logs but I can't find any problems.

Does anybody know where this problem may come from?

Thanks for your help.

bsddaemon
December 8th, 2008, 12:05
It should probably be:


create mask = 0600
directory mask = 0700


You dont wanna have all share files created and marked as executable, do you?

mousaka
December 8th, 2008, 13:50
I'm not sure, but I've never seen these modes in the global section.
According to smb.conf (http://us1.samba.org/samba/docs/man/manpages-3/smb.conf.5.html) they had to be defiened in each share section again.

mousaka

psunix
December 8th, 2008, 14:59
Hi

Thanks for your fast answer.

I'm sure it's correct to set create mode and directory mode in the global section to set the default.

@bsddaemon
You're right, but this won't fix my problem.

I now also tried to add "create mode" and "directory mode" in the share section.

# shares
[it]
path = /mnt/data1/share/it
writeable = yes
create mode = 0660
directory mode = 0770
...

but there is no change at all. :(
When I create a new directory, it's permission are still set to 0700.
And still the same problem when I create a new file.
I also tried "force create mode", same effect.

...

bsddaemon
December 8th, 2008, 15:35
My guess would be your server local umask overrides samba settings

- Can you change the settings to:


force create mode = 0660
force directory mode = 0770


- Or, in server, run


umask 007


Now in the client, create a new dir in the share, let's see if the permission has been changed as you wish

psunix
December 31st, 2008, 07:25
Hi

I fixed the problem.
Because I had these problems only with two shares/directories, I recreated them directly on the console. Now the file permissions are set correctly.

Thanks for your help.

psunix