logon script works with NT client, but not Win98

Frank Fuerst ffrank at rz.uni-potsdam.de
Tue Aug 1 16:21:09 GMT 2000


Hi,

I'm observing a strange phenomenon:

We have some WinNT- and Win98-clients in a Samba-NT-Domain, 
Samba is 2.0.7

A script, written under WinNT and transfered via pscp, with the sole 
content
net use t: \\server\share
is executed correctly if the client is WinNT [I know that I should add 
"/persistent:no" then]. But if I log on with a Win98 Client, it isn't: I 
see the Window "Logon Script is executed" with the Cancel-Button, 
and a DOS-Prompt-Window is coming up for a fraction of a second, 
but the drive is not beeing mapped. Also, if I add the line
notepad c:\test.txt 			# file exists
to the script, I don't get notepad with Win98.

If the client is brought back into a domain with an NT Server, logon 
scripts are executed.

This is my smb.conf, leaving browsing etc. out:

workgroup = seckler
domain logons = yes
server string = sugar
logon home = /var/export/homes/%U
# with logon home = [empty], the behavior was the same
logon path =
logon script = scripts/test.bat
domain admin group = @domadmin
security = user
guest account = nobody
encrypt passwords = yes
browseable = yes
include = /etc/samba/hosts_allow

[netlogon]
path = /var/export/smblogon
guest ok = no
writeable = no

[homes]
and so on.

Next thing, looking at the logfiles. In debug level 2, there are some 
differences, but nothing that would clear anything. In level 3, Samba 
is rather verbose, but I think I've identified the corresponding sections 
when logging in with NT and 98:

This how Samba talks to NT:

> [2000/08/01 16:03:51, 3] lib/util.c:unix_clean_name(522)
>   unix_clean_name [scripts/test.bat]
> [2000/08/01 16:03:51, 2] smbd/open.c:open_file(602)
>   sweta opened file scripts/test.bat read=Yes write=No 
>   (numopen=1)
> [2000/08/01 16:03:51, 3] >   
locking/locking_shm.c:shm_set_share_mode(456)
>   set_share_mode: Created share record for scripts/test.bat
> (dev 811 inode 700831)

This is the inode number of the requested file, test.bat

> [2000/08/01 16:03:51, 3] 
>   locking/locking_shm.c:shm_set_share_mode(495)
>   set_share_mode: Created share entry for scripts/test.bat with
>   mode 0x8020 pid= 15338
> [2000/08/01 16:03:51, 3] smbd/process.c:process_smb(618)
>   Transaction 29 of length 76
> [2000/08/01 16:03:51, 3] smbd/process.c:switch_message(448)
>   switch message SMBtrans2 (pid 15338)

watch the message type

> [2000/08/01 16:03:51, 3]
>   smbd/trans2.c:call_trans2qfilepathinfo(1302)
>   call_trans2qfilepathinfo: TRANSACT2_QFILEINFO: level = 258
> [2000/08/01 16:03:51, 3]
>   smbd/trans2.c:call_trans2qfilepathinfo(1363)
>   call_trans2qfilepathinfo scripts/test.bat level=258 call=7
>   total_data=0
> [2000/08/01 16:03:51, 3] smbd/process.c:process_smb(618)
>   Transaction 30 of length 64
> [2000/08/01 16:03:51, 3] smbd/process.c:switch_message(448)
>   switch message SMBreadX (pid 15338)

an other message type, it seems X means execute:

> [2000/08/01 16:03:51, 3] smbd/reply.c:reply_read_and_X(2322)
>   readX fnum=4980 min=4096 max=4096 nread=45

Obviously the client is told to read and execute the data.

***************

When connecting with the Win98-client it looks like this:

> [2000/08/01 16:03:10, 3] lib/util.c:unix_clean_name(522)
>   unix_clean_name [scripts/test.bat]
> [2000/08/01 16:03:10, 2] smbd/open.c:open_file(602)
>   sweta opened file scripts/test.bat read=Yes write=No
>  (numopen=1)
> [2000/08/01 16:03:10, 3]
>   locking/locking_shm.c:shm_set_share_mode(456)
>   set_share_mode: Created share record for scripts/test.bat
>   (dev 811 inode 70083 1)
> [2000/08/01 16:03:10, 3]
>    locking/locking_shm.c:shm_set_share_mode(495)
>   set_share_mode: Created share entry for scripts/test.bat with
>   mode 0x20 pid=15 336
> [2000/08/01 16:03:10, 3] smbd/process.c:process_smb(618)
>   Transaction 6 of length 45

Up to here, it's just the same

> [2000/08/01 16:03:10, 3] smbd/process.c:switch_message(448)
>   switch message SMBclose (pid 15336)

Above, we had message type SMBtrans2 at this point, and 
correspondingly it continues differently:

> [2000/08/01 16:03:10, 3] smbd/reply.c:reply_close(2791)
>   close fd=7 fnum=5052 (numopen=1)
> [2000/08/01 16:03:10, 2]
>   locking/locking_shm.c:shm_del_share_mode(355)
>   del_share_modes Deleting share mode entry dev=811 ino=700831
> [2000/08/01 16:03:10, 2]
>   locking/locking_shm.c:shm_del_share_mode(376)
>   del_share_modes num entries = 0, deleting share_mode dev=811
>   ino=700831

With NT, the share entry is also deleted, but a little later.

> [2000/08/01 16:03:10, 3] smbd/open.c:fd_attempt_close(162)
>   fd_attempt_close fd = 7, dev = 811, inode = 700831, open_flags =
>   0, ref_count = 1.
> [2000/08/01 16:03:10, 2] smbd/close.c:close_normal_file(159)
>   sweta closed file scripts/test.bat (numopen=0)
> [2000/08/01 16:03:10, 3] smbd/process.c:process_smb(618)
>   Transaction 7 of length 86
> [2000/08/01 16:03:10, 3] smbd/process.c:switch_message(448)
>   switch message SMBtrans2 (pid 15336)

It's not until here that they transfer the SMBtrans2, and they repeat:

> [2000/08/01 16:03:10, 3] smbd/trans2.c:call_trans2qfsinfo(1117)
>   call_trans2qfsinfo: level = 261
> [2000/08/01 16:03:10, 3] smbd/process.c:process_smb(618)
>   Transaction 8 of length 95
> [2000/08/01 16:03:10, 3] smbd/process.c:switch_message(448)
>   switch message SMBtrans2 (pid 15336)
> [2000/08/01 16:03:10, 3] smbd/trans2.c:call_trans2findfirst(668)
>   call_trans2findfirst: dirtype = 19, maxentries = 6,
>   close_after_first=0, close_if_end = 0 requires_resume_key = 0
>   level = 260, max_data_bytes = 2432

With NT, this was call_trans2qfilepathinfo

> [2000/08/01 16:03:10, 3] lib/util.c:unix_clean_name(522)
>   unix_clean_name [/SCRIPTS.???]
> [2000/08/01 16:03:10, 3] lib/util.c:unix_clean_name(522)
>   unix_clean_name [SCRIPTS.???]
> [2000/08/01 16:03:10, 3] lib/util.c:unix_clean_name(522)
>   unix_clean_name [./]

And now he doesn't know the filename any more.

I don't have any idea of c, but perhaps somebody else has 
encountered this before and doesn't need to go into the sourcecode..

Any hint would be appreciated 

Frank Fürst
-- 
Frank Fuerst, Institut fuer Biochemie und Biologie der Uni Potsdam
Karl-Liebknecht-Str. 24-25, Haus 25, 14476 Golm
Tel.: +49-331-977-5244;   Fax.: +49-331-977-5062
ffrank at rz.uni-potsdam.de



More information about the samba-ntdom mailing list