1820098 Members
3545 Online
109608 Solutions
New Discussion юеВ

Samba: file permissions

 
Enrico Blanzola
Advisor

Samba: file permissions

Hi @,
I've a problem with file permissions in a Samba environment. Samba server is an hp-ux 11i and a particular directory ("/applicazioni/fotografie/immagini_salvate") is shared to some windows servers (in a specific subnet).When a windows user try to copy a txt file under this directory, the permission of this copied file are 600. We wish to have, instead, 777 for every file.
These are the lines relatives to this dir in smb.conf:
[applicazioni]
path = /applicazioni
public = no
writable = yes
create mode = 0777
create mask = 0777
case sensitive = yes
hosts allow = 192.168.

The ownership of files under the dir "/applicazioni/fotografie/immagini_salvate" is "oracle:dba".
Thanks.
Enrico
8 REPLIES 8
Franky_1
Respected Contributor

Re: Samba: file permissions

Hi,

normally a file created has the permission "666" whereas dir's have "777" if *no* umask is set
The execute permission for a file is never set by default even if you set create mode to "0777" or umsak to "000"

Regards

Franky
Don't worry be happy
Enrico Blanzola
Advisor

Re: Samba: file permissions

Hi Franky,
infact I setted the parameter "create mask" as 0777, but it doesn't work. Anytime the win user *copy* a txt file under that dir, this file has 600 as permissions, not 777. Maybe the right parameter is not "create mask" but another, but I don't know which.
thanks.
Massimo Bianchi
Honored Contributor

Re: Samba: file permissions

Hi Enrico,
some points come to my mind:

- ownership is correctly preserved ?
- which is the umask ?
- is a workaround acceptable (like a cron job that fixes permissions ) ?
- what is the Samba Version ?

Regards,
Massimo
BONNAFOUS Jean Marc
Trusted Contributor

Re: Samba: file permissions

Hi,

See perhaps 'directory mode' (or 'directory mask'). If Windows version is W2K/NT/XP see also 'security mask' and/or 'directory security mask' values

(http://us3.samba.org/samba/docs/man/smb.conf.5.html)

HTH

JMB
Si vous ne faites jamais de b├йtises, c'est que vous ne faites rien de difficile. Et ├зa c'est une grosse b├йtise.
Franky_1
Respected Contributor

Re: Samba: file permissions

Hi again,

you'll need to set the following parameter :

force create mode = 0777

and then it works !

Regards

Franky
Don't worry be happy
Geoff Wild
Honored Contributor

Re: Samba: file permissions

I set my global permissions at:

create mask = 0775
force create mode = 0775
directory mask = 0775


On the shares themselves:

force directory mode = 0775


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Franky_1
Respected Contributor

Re: Samba: file permissions

Hi Enrico,

did our last posts solve your problem (at least they did when i tried it in my environment :)
If so, then please don't forget to assign points

Regards

Franky
Don't worry be happy
Enrico Blanzola
Advisor

Re: Samba: file permissions

Hi,
I've solved the problem forcing user and group for that directory; so, parameters for "/applicazioni" dir are:

[applicazioni]
path = /applicazioni
public = no
writable = yes
force user = oracle
force group = dba
create mode = 0777
create mask = 0777
force create mode = 777
force directory mode = 777
security mask = 0777
case sensitive = yes
hosts allow = 192.168.


Thanks to all,
Enrico