strupper() on username and domain in cli_session_setup_nt1()?

Tim Potter tpot at samba.org
Mon Sep 23 07:14:01 GMT 2002


I'm just wondering whether it is strictly necessary to uppercase the
username and domain name when performing a session setup.  Applying the
following patch should not break anything and would make smbclient be
able to test for case sensitivity bugs in the remote server.

The behaviour of uppercasing everything seems to be peculiar to Windows
9x.  According to some testing done by the HP guys and girls, NT and
2000 send across the case of the username as it was created in the SAM,
whereas XP sends the case the user logged in with.


Tim.

Index: client/client.c
===================================================================
RCS file: /data/cvs/samba/source/client/client.c,v
retrieving revision 1.220
diff -u -r1.220 client.c
--- client/client.c	5 Sep 2002 11:40:06 -0000	1.220
+++ client/client.c	23 Sep 2002 07:00:07 -0000
@@ -2758,7 +2758,6 @@
 			got_pass = True;
 			memset(strchr_m(getenv("USER"),'%')+1,'X',strlen(password));
 		}
-		strupper(username);
 	}
 
 	/* modification to support PASSWD environmental var
@@ -2775,7 +2774,6 @@
 
 	if (*username == 0 && getenv("LOGNAME")) {
 		pstrcpy(username,getenv("LOGNAME"));
-		strupper(username);
 	}
 
 	if (*username == 0) {
Index: libsmb/cliconnect.c
===================================================================
RCS file: /data/cvs/samba/source/libsmb/cliconnect.c,v
retrieving revision 1.106
diff -u -r1.106 cliconnect.c
--- libsmb/cliconnect.c	17 Sep 2002 12:12:50 -0000	1.106
+++ libsmb/cliconnect.c	23 Sep 2002 07:01:19 -0000
@@ -317,8 +317,8 @@
 	p = smb_buf(cli->outbuf);
 	memcpy(p,pword,passlen); p += passlen;
 	memcpy(p,ntpword,ntpasslen); p += ntpasslen;
-	p += clistr_push(cli, p, user, -1, STR_TERMINATE|STR_UPPER);
-	p += clistr_push(cli, p, workgroup, -1, STR_TERMINATE|STR_UPPER);
+	p += clistr_push(cli, p, user, -1, STR_TERMINATE);
+	p += clistr_push(cli, p, workgroup, -1, STR_TERMINATE);
 	p += clistr_push(cli, p, "Unix", -1, STR_TERMINATE);
 	p += clistr_push(cli, p, "Samba", -1, STR_TERMINATE);
 	cli_setup_bcc(cli, p);



More information about the samba-technical mailing list