I have a samba share that has the following permissions: create mask = 0775 force create mode = 0664 directory create mask = 0775 force directory mode = 0764 1.) Does this means DOS/windows files will be created as rwxrwxr-x per "create mask" or rw-rw-r-- per "force create mode"? 2.) Do I need both create mask & force create mode or is one overkill? 3.) Is "directory create mask" an unknown option? 4.) Does force directory mode mean all dos/windows directories created will be drwxrw-r--? 5.) I have a basic .txt file I created on my windows desktop by right-clicking>new>text document. I copy that file over to the share in question & it gets the following permission: -rwxr--r-- where is it getting that permission from as I'm expecting it to have 0775 or 0664 permisions & neither is coming over. Please help! Thanks in advance!
On 08/31/2010 10:54 PM, Han Solo wrote:> I have a samba share that has the following permissions: > > create mask = 0775 > force create mode = 0664 > directory create mask = 0775 > force directory mode = 0764 > > 1.) Does this means DOS/windows files will be created as rwxrwxr-x per > "create mask" or rw-rw-r-- per "force create mode"?a mask is a "removal" of bit in the permission, so you get that a bit wrong :-) say you have permissions of 777 which in binary is 111-111-111 and a mask of 022 which is 000-010-010 you have to do the following to get the final permissions: 111-111-111 - 000-010-010 = 111-101-101 which is 755 N.> 2.) Do I need both create mask& force create mode or is one overkill? > 3.) Is "directory create mask" an unknown option? > 4.) Does force directory mode mean all dos/windows directories created will > be drwxrw-r--? > 5.) I have a basic .txt file I created on my windows desktop by > right-clicking>new>text document. I copy that file over to the share in > question& it gets the following permission: -rwxr--r-- where is it getting > that permission from as I'm expecting it to have 0775 or 0664 permisions& > neither is coming over. > > Please help! Thanks in advance!
On Tue Aug 31 2010 22:54:17 GMT+0200 Han Solo <gforums2010 at gmail.com> wrote:> I have a samba share that has the following permissions: > > create mask = 0775 > force create mode = 0664 > directory create mask = 0775 > force directory mode = 0764 > > 5.) I have a basic .txt file I created on my windows desktop by > right-clicking>new>text document. I copy that file over to the share in > question& it gets the following permission: -rwxr--r-- where is it getting > that permission from as I'm expecting it to have 0775 or 0664 permisions& > neither is coming over.I'm experiencing a similar problem (see my post at http://lists.samba.org/archive/samba/2010-August/157775.html). Could you please try the following: - set your "create mask" and "force create mode" both to 664; this should result in 664 for all new files (the first removes all bits that are not in 664, and the latter adds all bits still missing to 664) - create a text file on your share; according to your statement the permissions should be different from 664 - in windows, open the security settings for that file and change something, e.g. give the group full access; if it's the same issue as mine, it shouldn't really matter what you change - confirm and close the security settings - now look at the permissions on your linux machine; do they fit your presets now? With best regards, Alex
On Tue Aug 31 2010 23:02:26 GMT+0200 Nicolas Jungers <nicolas at jungers.net> wrote:> > a mask is a "removal" of bit in the permission, so you get that a bit > wrong :-) > > say you have permissions of 777 which in binary is 111-111-111 and a > mask of 022 which is 000-010-010 you have to do the following to get the > final permissions: > 111-111-111 > - 000-010-010 > = 111-101-101 > > which is 755 > > N. >According to the manual your example is not right. The "create mask" will be logically ANDed with the current/default permissions and the "force create mode" will be ORed. For your example that means: 111-111-111 AND 000-010-010 = 000-010-010 It is right that the "create mask" removes bits, but not the way you showed it. The manual says about "create mask": "Any bit not set here will be removed from the modes set on a file when it is created." Because the "force create mode" will be ORed, it adds bits. These bits are guaranteed to be set on the file. Extended example with "force create mode" of 110-100-100: 111-111-111 AND 000-010-010 (create mask) = 000-010-010 OR 110-100-100 (force create mode) = 110-110-110 With best regards, Alex