Operating System - HP-UX
1833589 Members
4028 Online
110061 Solutions
New Discussion

wrong protections on new files in Samba Share

 
SOLVED
Go to solution
Peter Heinemann
Frequent Advisor

wrong protections on new files in Samba Share

Files being written into a samba share aren't being granted the desired permissions.

The share config is:

[ui]
path = /opt/axiom/workspace
public = yes
guest ok = yes
writeable = yes
write list = pcguest
create mask = 774
force create mode = 774
inherit permissions = yes

Yet the files are created with the incorrect group settings. The settings for Other were corrected after adding the "create mask" directive, but for some reason group still won't go right.

Here's the parent directory permission (for the effect of Inherit Permissions = yes)
# ll -d /opt/axiom/workspace
drwxrwxrwx 3 axadmin axiom 1024 Apr 2 10:26 /opt/axiom/workspace/

# ll /opt/axiom/workspace
total 14
drwxrwxrwx 3 axadmin axiom 1024 Apr 2 10:26 ./
drwxrwxr-x 14 axadmin axiom 1024 Apr 2 10:37 ../
drwxrwxr-x 14 axadmin axiom 1024 Apr 1 16:34 axiom_source/
-rwxrw-r-- 1 pcguest axiom 8 Apr 2 09:59 testfile.txt*
-rwxrw-r-- 1 pcguest axiom 8 Apr 2 10:03 testfile1.txt*
-rwxrw-rw- 1 pcguest axiom 8 Apr 2 10:05 testfile2.txt*
-rwxrw-rw- 1 pcguest axiom 8 Apr 2 10:26 testfile3.txt*

Thanks for any help/information
2 REPLIES 2
Darren Prior
Honored Contributor
Solution

Re: wrong protections on new files in Samba Share

Hi Peter,

File permissions are a confusing beast where Samba is concerned!

You may have confused yourself (& Samba) a bit by your config.

The inherit permissions parm will override the create mask and force create mode parms. On top of that the HPUX execute bits are manipulated according to the various map archive, map system, map hidden parms - this allows various functionality from the Win/DOS side.

If you want the file perms to be 774, then just set inherit permissions = no, the rest of your settings are fine. I've just done a quick test on a CIFS/9000 A.01.09.02 server and saved some files from Notepad; their perms are 774 using your settings.

It's worth remembering that the various map settings mentioned above mean that the various permission bits mean something different to the HPUX/DOS machines. Running the command testparm will dump all your current parms from smb.conf, also displaying the default values that you haven't entered into smb.conf.

There's some good reading on permission related parms in the O'Reilly Using Samba book - p140 onwards or within Chapter 5 if you're accessing the book via SWAT. The various parms are also documented in the smb.conf man page, also available via SWAT.

regards,

Darren.

Calm down. It's only ones and zeros...
Peter Heinemann
Frequent Advisor

Re: wrong protections on new files in Samba Share

Darren - thanks! taking out the inherit did the trick.

I had read the smb.conf man page -- but as you say it's tricky.