Bug 4156 - smbclient does not request all optimal dialects during negprot - regarding OS/2
Summary: smbclient does not request all optimal dialects during negprot - regarding OS/2
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.23c
Hardware: Other OS/2
: P3 normal
Target Milestone: none
Assignee: Derrell Lipman
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-08 17:26 UTC by Guenter Kukkukk
Modified: 2006-10-12 14:50 UTC (History)
1 user (show)

See Also:


Attachments
dialect index 4 had to be used here (2.80 KB, application/octet-stream)
2006-10-08 17:28 UTC, Guenter Kukkukk
no flags Details
smbclient source modified - OK now. Dialect index 5 is used now. (2.77 KB, application/octet-stream)
2006-10-08 17:30 UTC, Guenter Kukkukk
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guenter Kukkukk 2006-10-08 17:26:23 UTC
Hi Derrell,

smbclient (svn version 19167) does not request all optimal
smb dialects during negprot - here "LANMAN2.1" is not offered
for negotiation (OS/2 related)

Steve French dropped me a note about this - and I must agree.

smbclient is using "DOS LANMAN2.1" only - but not "LANMAN2.1" -
as a protocol string.

As already discussed on irc, both might have valid historical
backgrounds... - but in the OS/2 case the older "LM1.2X002" dialect
is choosen sub-optimal.

I'll send 2 sniffs
 - smbclient_warpserver50_negprot_not-optimal-dialect.cap
 - smbclient_warpserver50_negprot_OK_smbclient-source-modified.cap

In the first case dialect index 4 is used, in the 2nd one index 5!

In the 2nd case I modified cliconnect.c:
(replaced "DOS LANMAN2.1" with "LANMAN2.1")

static const struct {
	int prot;
	const char *name;
} prots[] = {
	{PROTOCOL_CORE,"PC NETWORK PROGRAM 1.0"},
	{PROTOCOL_COREPLUS,"MICROSOFT NETWORKS 1.03"},
	{PROTOCOL_LANMAN1,"MICROSOFT NETWORKS 3.0"},
	{PROTOCOL_LANMAN1,"LANMAN1.0"},
	{PROTOCOL_LANMAN2,"LM1.2X002"},
	{PROTOCOL_LANMAN2,"LANMAN2.1"},
	{PROTOCOL_LANMAN2,"Samba"},
	{PROTOCOL_NT1,"NT LANMAN 1.0"},
	{PROTOCOL_NT1,"NT LM 0.12"},
	{-1,NULL}
};

As already discussed on irc, both variants might be valid.

Cheers, Guenter

btw - I dropped the sniffs against win98SE - it is using "NT LM 0.12".
Comment 1 Guenter Kukkukk 2006-10-08 17:28:36 UTC
Created attachment 2179 [details]
dialect index 4 had to be used here
Comment 2 Guenter Kukkukk 2006-10-08 17:30:04 UTC
Created attachment 2180 [details]
smbclient source modified - OK now. Dialect index 5 is used now.
Comment 3 Derrell Lipman 2006-10-11 14:21:52 UTC
Jeremy, please check this.  On the assumption that we're not absolutely sure that "DOS LANMAN2.1" is never seen in the wild, I opted to add a new protocol option string rather than "fixing" the existing one.  Do you see any problem with this approach?

Derrell

Index: libsmb/cliconnect.c
===================================================================
--- libsmb/cliconnect.c	(revision 19230)
+++ libsmb/cliconnect.c	(working copy)
@@ -33,6 +33,7 @@
 	{PROTOCOL_LANMAN1,"LANMAN1.0"},
 	{PROTOCOL_LANMAN2,"LM1.2X002"},
 	{PROTOCOL_LANMAN2,"DOS LANMAN2.1"},
+	{PROTOCOL_LANMAN2,"LANMAN2.1"},
 	{PROTOCOL_LANMAN2,"Samba"},
 	{PROTOCOL_NT1,"NT LANMAN 1.0"},
 	{PROTOCOL_NT1,"NT LM 0.12"},
Comment 4 Jeremy Allison 2006-10-11 14:35:27 UTC
No this looks correct to me. Please commit.
Jeremy.
Comment 5 Derrell Lipman 2006-10-11 14:56:28 UTC
Should be fixed by check-in 19250.

Derrell
Comment 6 Thomas Bork 2006-10-12 14:50:07 UTC
(In reply to comment #5)
> Should be fixed by check-in 19250.

And is not in SAMBA_3_0_23.