From 82290216ad827c9f8f74ffd3aa6a37dca28174e1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 3 Sep 1997 20:15:40 +0000 Subject: nameannounce.c nameresp.c nameserv.c nameservreply.c proto.h : Removed broadcast and recurse parameters in the queue_netbios_pkt_wins() call - they are not needed as they should always be 'false' and 'true' respectively. Also fixed a bug with secure name registration (WINS server code). server.c: Finally fixed problem with error 267 being returned to Win95. It is needed by NT. This is a horrid fix and I would appreciate a better one :-). Jeremy (jallison@whistle.com) (This used to be commit fa1305d1894a28331ba80d9de038ebf31ba902d6) --- source3/smbd/server.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 50f3214919..a65ffdd81c 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1985,9 +1985,10 @@ struct int new_smb_error; int old_smb_error; int protocol_level; + char *valid_remote_arch; } old_client_errmap[] = { - {ERRbaddirectory, ERRbadpath, (int)PROTOCOL_NT1}, + {ERRbaddirectory, ERRbadpath, (int)PROTOCOL_NT1, "WinNT"}, {0,0,0} }; @@ -1996,6 +1997,7 @@ struct ****************************************************************************/ int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line) { + extern fstring remote_arch; int eclass=def_class; int ecode=def_code; int i=0; @@ -2024,9 +2026,19 @@ int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int /* Make sure we don't return error codes that old clients don't understand. */ + /* JRA - unfortunately, WinNT needs some error codes + for apps to work correctly, Win95 will break if + these error codes are returned. But they both + negotiate the *same* protocol. So we need to use + the revolting 'remote_arch' string to tie break. + + There must be a better way of doing this... + */ + for(i = 0; old_client_errmap[i].new_smb_error != 0; i++) { - if((Protocol < old_client_errmap[i].protocol_level) && + if(((Protocol < old_client_errmap[i].protocol_level) || + !strcsequal( old_client_errmap[i].valid_remote_arch, remote_arch)) && (old_client_errmap[i].new_smb_error == ecode)) { ecode = old_client_errmap[i].old_smb_error; -- cgit