[Samba] root preexec

Sean Fitzpatrick
Tue, 27 Aug 2002 11:17:00 -0000

I am running LM 8.2 as a server serving 50+ Win 9x machines with samba
2.2.3.
In my samba configuration I have a "root prexec" command which is
executed
when a new user  logs in. It creates a sub folder in their home folder and
changes the owenership of this  folder to the user and their group.

The following is the relative samba configuration:-

[homes]
comment = Home Directories
path = %H/samba
read only = No
browseable = No
root preexec = mkdir -m 750 %H/samba;chown %u.%g %H/samba

The "path=%H/samba" statement in the homes section is used as a
security
feature. It directs  the logon user to a folder called samba in their user
account. They cannot see outside this  folder.

This system worked fine up to samba 2.2.2a

It doesn't work any more!!!

When a new user logs in the folder samba is not created as it should be
(this is the  function of the root preexec command). If I change my path
command to read "path=%H" then  the root preexec command is executed
thus
creating the samba folder but of course the user  now has access to their
base account folder, which is what I want to avoid.

My conclusion - For a new account, when the samba folder is not yet created
the path command  cannot find this folder therefore the rest of the path
statements are not implemented.
I do not know whether this is a bug in samba 2.2.3 or whether it is a
deliberate change.

Can anyone throw some light on the subject for me please.

Sean