[PATCH] dos mask readonly feature for samba 3.0.10

Maier, Thomas Thomas.Maier at IZB-SOFT.de
Mon Jan 3 15:23:04 GMT 2005

Hello Samba Devs,

we want to supply a patch for Samba, based on the latest released Samba
3.0.10 source code.

We call the patch:  dos mask readonly patch

Patch features:
The "dos mask readonly" patch supplies the ability to mask the dos readonly
attribut on samba shares.
E.g. a file on the unix side with permissions r--r--r-- will look on the
windows side as
readonly attribut = not set. But the file keeps readonly!

The new option for the smb.conf is:    dos mask readonly = yes|no

You can use it in the [globals] section or in a share definition section.

Default setting for "dos mask readonly" is "no".

Why did we do this, or why it can be useful:
If you copy files from a readonly samba share using the windows explorer or
some other tools,
file attributes are preserved at the copied file. In some cases this is not
desired if the copied
files should or must not be readonly. In such cases you have to a) remove
the readonly attribut
(manually) or b) use a copy tool that does not preserve file attributes.
Our situation: we have a database tool that should import files from a
readonly samba share into
its database. But the imported files must not have the readonly attribut
set! The only way to do
this without this patch is to do an extra copy step and remove the readonly
attribut before the
import. This is not acceptable (time problems) if you have to copy/import
large amount of files (>10 GB).

We are now running Samba 3.0.4 with the "dos mask readonly" patch for a long
time on Sun Solaris 8 (sparc)
and it works nicely ;)
The patched code parts keeps the same in 3.0.4 and 3.0.10, so the supplied
patch is for Samba 3.0.10 now.

Modified files:

The patch file was generated with GNU diff -Nur

Would be glad if this patch will make it into Samba.


Thomas Maier

Bereich S84
St.-Martin-Straße 47
81541 München
Telefon: 089/4907-2151
E-Mail: mailto:Thomas.Maier at izb-soft.de
Internet: http://www.izb-soft.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-samba.3.0.10-dosmaskro.gz
Type: application/octet-stream
Size: 1984 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20050103/84694916/patch-samba.3.0.10-dosmaskro.obj

More information about the samba-technical mailing list