I have defined the following share in smb.conf

[development_server]
    comment = Development directories
    path = /sites
    writeable = yes
    valid users = @dev
    guest ok = no
    directory mask = 0775
    create mask = 0775

The problem is that whenever I create a file within windows the permissions of that file are set as 764 instead of being set as 755. Directories however are set correctly with 775. I am confused. I tried setting the following:

[global]
    unix extensions = yes

But this did not help either.

share|improve this question
up vote 2 down vote accepted

The problem turned out to be the security mode settings within my configuration (or lack there of). The following smb.conf configuration is now working for me and all users within my security group "dev" now have 775 for all files they create within the share:

[development_server]
    comment = Development directories
    path = /sites
    writeable = yes
    valid users = @dev
    guest ok = no

    create mask = 0775
    force create mode = 0775
    security mask = 0775
    force security mode = 0775

    directory mask = 0775
    force directory mode = 0775
    directory security mask = 0775
    force directory security mode = 0775

I found this solution while digging through askubuntu

share|improve this answer

create mask can only be used to prevent a permission bit to be set, as the mask is bitwise ANDed with the bits the client tried to set. If the mask is set to 7, but the client tries something less, e.g. 6, the client "wins" as 0 AND 1 for the execute bit is 0.

force create mask works the other way around, it will bitwise OR the mask to what the client tries to set, so if you set a 7 here, every bit will end up with x OR 1, which is always 1.

To force the value 0775 regardless of what the client tries to set, you have to combine the two:

create mask = 0770   (0000 would also work)
force create mask = 0775

See the documentation.

share|improve this answer
1  
after setting create mask = 0770 and force create mask = 0775 my permissions then become 760 on newly created files – nullReference Nov 18 '14 at 1:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.