# Samba and default chmod



## psunix (Dec 8, 2008)

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
> ...



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 (Dec 8, 2008)

It should probably be:



> create *mask* = 0*6*00
> directory *mask* = 0700



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


----------



## mousaka (Dec 8, 2008)

I'm not sure, but I've never seen these modes in the global section.
According to smb.conf they had to be defiened in each share section again.

mousaka


----------



## psunix (Dec 8, 2008)

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
> ...



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 (Dec 8, 2008)

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 (Dec 31, 2008)

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


----------

