What do the "create mask = " and/or "directory mask = " do in the
smb.conf file? I have the general gist of it, they set the default
preferences for files and directories. However, they have four digits
instead of three: 0644 vs 644. I don't understand this, and my google
searches are not very productive in answering this (neither is my
O'reilly book or any of the other reference books I have). In an
smb.conf file from my e-smith server has FIVE digits, at least in the
printer section: 02750. I also would like to know what the difference
is between "create mode" and "create mask", and "directory mask" vs
"directory mode". Finally, why set these in global settings instead of
in the individual shares? I guess if you want all settings to be the
same, printers and directories, you'd set them in the global, right?
And to override global settings for these you'd set them in the
individual directory sections, correct?
TIA,
Ari
--
Are you registered as a bone marrow donor? You regenerate what you
donate. You are offered the chance to donate only if you match a person
on the recipient list. Call your local Red Cross and ask about
registering to be a bone marrow donor.
spam trap: replace shyah_right with hotmail when replying
> Hi again all,
>
> What do the "create mask = " and/or "directory mask = " do in the
create mask is the bits that can exist when something is created.
For example if the mask is 0444 (or 000 , 100 , 100 , 100 in binary) only
the R attribute can be set on newly created files.
remember the Read, Write & Exec flags are bits, so 100 means Read is set ,
but write and exec are off.
A mask of 0444 would mean that all files created would become read-only.
Make sense ?
directory mask is the same thing, but for directories.
> smb.conf file? I have the general gist of it, they set the default
> preferences for files and directories. However, they have four digits
> instead of three: 0644 vs 644. I don't understand this, and my google
The leading zero is usually there to signify hex digits. 0644 and 644 are
effectively the same.
> searches are not very productive in answering this (neither is my
> O'reilly book or any of the other reference books I have). In an
> smb.conf file from my e-smith server has FIVE digits, at least in the
> printer section: 02750. I also would like to know what the difference
The fourth digit (2) in this case controls the sticky/suid bit bit. check
out 'man chmod' for more info on that. I think the stick bit is useful for
samba to stop something, like users deleting other peoples files.
> is between "create mode" and "create mask", and "directory mask" vs
> "directory mode". Finally, why set these in global settings instead of
create mode is a synonym for create mask
ditto for directory mode / directory mask
> in the individual shares? I guess if you want all settings to be the
> same, printers and directories, you'd set them in the global, right?
> And to override global settings for these you'd set them in the
> individual directory sections, correct?
Sounds reasonable, i think at some point these params got moved from global
to shares, perhaps because printers and file shares had different
requirements ?
If you're looking to setup a samba server for many users and get frustrated
by users not being able to edit each others files and so on, consider using
a file system that supports ACLs underneath samba. XFS does, and ext3 does
(with patches ?).
>
> TIA,
>
> Ari
>
> spodosaurus wrote:
>
>> Hi again all,
>>
>> What do the "create mask = " and/or "directory mask = " do in the
>
> create mask is the bits that can exist when something is created.
>
> For example if the mask is 0444 (or 000 , 100 , 100 , 100 in binary) only
> the R attribute can be set on newly created files.
>
> remember the Read, Write & Exec flags are bits, so 100 means Read is set ,
> but write and exec are off.
>
> A mask of 0444 would mean that all files created would become read-only.
>
> Make sense ?
PS: You probably want something like 0775 as a starting point, so people
have no trouble editing there own files, but others can't trash them. Keep
in mind that 0775 doesn't SET the bits, it merely limits those that can be
set. If a user tries to create a file with 0600 permissions, it will end up
with 0600 permissions.
If you want to control how file permissions are set at creation time, check
out 'force create mode' or 'force group'
You meant octal I'm sure.
Also useful are the force bit parameters for when you are have a share
for a group and you want to make sure that the members cannot create
directories or files that are not writable by others.
> |The leading zero is usually there to signify hex digits. 0644 and 644 are
> |effectively the same.
>
> You meant octal I'm sure.
good point! 644 hex and 644 octal are the same number, of course. but
'0644' = octal, '0x644' = hex, '644' = decimal - in standard notation.
will
> good point! 644 hex and 644 octal are the same number, of
course. but
> '0644' = octal, '0x644' = hex, '644' = decimal - in
standard notation.
Umm ... no doubt they flip the same least significant bits,
which may be all that counts here, but doesn't:
0644 = 64*6 + 8*4 + 4
but
0x644 = 256*6 + 16*4 + 4
>> good point! 644 hex and 644 octal are the same number, of
> course. but
>> '0644' = octal, '0x644' = hex, '644' = decimal - in
> standard notation.
>
> Umm ... no doubt they flip the same least significant bits,
> which may be all that counts here, but doesn't:
>
> 0644 = 64*6 + 8*4 + 4
> but
> 0x644 = 256*6 + 16*4 + 4
ummm... yeah! of course. they're nothing like the same number at all, are
they? not even in that context! for some reason, in my head, each digit
had conveniently arranged itself neatly into a separate 'nybble'...
duuuuhhhh....
will