[Samba] Per-directory "create mask"?

Jonathan Woithe jwoithe at physics.adelaide.edu.au
Thu Sep 25 07:24:48 GMT 2003

Hi all

Please CC me any replies.

I am currently running samba 2.2.8a under Slackware 8.1 (kernel 2.4.18) to
provide fileserver services to a number of windows 2000 boxes via a single
"resources" share.  One of the things stored in this share is a collection
of Protel libraries used in electronic circuit design.

The problem is that protel implements its own access control mechanism for
these libraries.  When the first user accesses a library, a control file is
created by protel.  When subsequent users open/access the libraries, protel
wants to access and modify this control file. The problem is that the
control file is owned by the first user to start protel at a given time. 
The users' umasks are set to allow only "user" write permission (as is
sensible) - the problem is that other users then can't alter this file.

The first user can do a manual chmod after starting protel to allow group
writes (at which point things work fine) but the chmod remains in force
until the file is deleted - which happens when the last user finishes using

What I need is a way to enable a group-writeable file creation mask for
files created in a single directory of the share, or, more generally, a way
to specify "create mask" or "force create mode" for specific subdirectories
of a share (not for the entire share).

I've thought of a number of possible ways of solving this problem, but none
of them are particularly attractive.
 1) Move the server (or at least the protel users) to a "user group" regime
 2) write a small samba VFS module to trap creations in this one directory
    and deal with them accordingly
 3) set up a separate share for the protel libraries and force masks in that

Does anyone have any other suggestions?

Best regards
* Jonathan Woithe    jwoithe at physics.adelaide.edu.au                        *
*                    http://www.physics.adelaide.edu.au/~jwoithe            *
** "Time is an illusion; lunchtime doubly so"                              **
*  "...you wouldn't recognize a subtle plan if it painted itself purple and *
*   danced naked on a harpsichord singing 'subtle plans are here again'"    *

More information about the samba mailing list