Problem with preexec ?

Andras S. Haramasz aharamas at optonline.net
Fri Mar 7 03:23:41 GMT 2003


Hi there,

A simple perl script creates logon batch file (%m.%u.bat) based on user’s
name, client-machine and assigns shares based on user’s primary group. It is
created on the netlogon share. The file can be something like this:

net time \\linux /set /yes
net use n: \\linux\netlogon
net use h: \\linux\homes
net use p: \\linux\public
net use t: \\linux\tmp
net use w: \\linux\Work
net use n: /d /y

If the user comes from Windows NT, XP or 2K, adding driver takes for ever
(each drive a minute or so). Coming from Windows 9x just fails with:

“Error 55: The specified resource is not available. The computer that shared
the resource might have been turned off, or the permissions might have been
changed. For more information, contact your network administrator”
Setting time and adding netlogon share is without any problem.

Interestingly enough, when preexec is not used, the same batch file from
netlogon share works no problem whatsoever.  I’d like to create those batch
files based on users, machine, etc. at logon time. Any help would be
appreciated.
Thanks. Andras

Here is my configuration file.

[global]
   workgroup = MPI
   netbios name = LINUX
   server string = MPI
   interfaces = 192.168.1.11/24 127.0.0.1/8
   encrypt passwords = Yes
   passwd program = /usr/bin/passwd %u
   passwd chat = "*Enter OLD password*" %o\n "*Enter NEW password*" %n\n
"*Reent
er NEW password*" %n\n "*Password changed*"
   username map = /etc/samba.d/private/smbusers
   log file = /var/log/samba.d/%m.log
   time server = Yes
   socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192
SO_SN
DBUF=8192
   logon script = %m.%u.bat
   logon path = \\%N\%U\profile.%m
   logon drive = H:
   logon home = \\%L\%U\profile.%m
   domain logons = Yes
   os level = 99
   preferred master = Yes
   domain master = Yes
   wins support = Yes
   lock dir = /var/cache/samba.d
   remote announce = 192.168.1.255 192.168.1.11
   admin users = root ash
   hosts allow = 192.168.1. 127. 12.88.198.
   profile acls = Yes
   csc policy = disable
   root preexec = /etc/samba.d/logon.pl %u %G %L %m %a %U

[homes]
   comment = Home
   path = %H
   valid users = %S
   read only = No
   create mask = 0770
   directory mask = 0770
   inherit acls = Yes
   guest ok = no

[netlogon]
   comment = NetLogOn
   path = /etc/samba.d/netlogon
   browseable = No
   locking = No
   share modes = No

[tmp]
   comment = Temp Files
   path = /var/tmp
   read only = No
   guest ok = Yes

[profiles]
   path = \\%L\%H\profile.%m
   read only = No
   create mask = 0600
   directory mask = 0700

[public]
#  path = /var/ftp/pub
   path = /mnt/hdc/mpi10/public
   read only = No
   create mask = 0771
   directory mask = 0770
   guest ok = Yes

[Work]
   comment = Work
   path = /usr/local/MPI/Mpiwork
   valid users = @mpiw
   read only = No
   create mask = 0770
   directory mask = 0770
   guest ok = no

[Account]
   comment = Account
   path = /usr/local/MPI/Accounting
   valid users = @mpia
   read list = @mpia
   write list = Arlene, ibh
   read only = No
   create mask = 0770
   directory mask = 0770
   guest ok = no

[Corp]
   comment = Corp
   path = /usr/local/MPI/Corporate
   valid users = @mpic
   write list = Alan
   read only = No
   create mask = 0770
   directory mask = 0770
   guest ok = no

[Mgt]
   comment = Mgt
   path = /usr/local/MPI/Management
   valid users = @mpim
   read only = No
   create mask = 0770
   directory mask = 0770
   guest ok = no



More information about the samba-technical mailing list