svn commit: samba r17246 - in branches: SAMBA_3_0/source/passdb SAMBA_3_0_23/source/passdb

jerry at samba.org jerry at samba.org
Tue Jul 25 21:48:13 GMT 2006


Author: jerry
Date: 2006-07-25 21:48:13 +0000 (Tue, 25 Jul 2006)
New Revision: 17246

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17246

Log:
BUG 3964: lower case username prior to getpwnam() call in smbpasswd
Modified:
   branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c
   branches/SAMBA_3_0_23/source/passdb/pdb_smbpasswd.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c
===================================================================
--- branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c	2006-07-25 21:33:13 UTC (rev 17245)
+++ branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c	2006-07-25 21:48:13 UTC (rev 17246)
@@ -1192,6 +1192,7 @@
 			      struct samu *sam_pass, const struct smb_passwd *pw_buf)
 {
 	struct passwd *pwfile;
+	fstring unix_username;
 	
 	if ( !sam_pass ) {
 		DEBUG(5,("build_sam_account: struct samu is NULL\n"));
@@ -1199,8 +1200,11 @@
 	}
 
 	/* verify the user account exists */
+
+	fstrcpy( unix_username, pw_buf->smb_name );
+	strlower_m( unix_username );
 			
-	if ( !(pwfile = getpwnam_alloc(NULL, pw_buf->smb_name)) ) {
+	if ( !(pwfile = getpwnam_alloc(NULL, unix_username )) ) {
 		DEBUG(0,("build_sam_account: smbpasswd database is corrupt!  username %s with uid "
 		"%u is not in unix passwd database!\n", pw_buf->smb_name, pw_buf->smb_userid));
 			return False;

Modified: branches/SAMBA_3_0_23/source/passdb/pdb_smbpasswd.c
===================================================================
--- branches/SAMBA_3_0_23/source/passdb/pdb_smbpasswd.c	2006-07-25 21:33:13 UTC (rev 17245)
+++ branches/SAMBA_3_0_23/source/passdb/pdb_smbpasswd.c	2006-07-25 21:48:13 UTC (rev 17246)
@@ -1189,6 +1189,7 @@
 			      struct samu *sam_pass, const struct smb_passwd *pw_buf)
 {
 	struct passwd *pwfile;
+	fstring unix_username;
 	
 	if ( !sam_pass ) {
 		DEBUG(5,("build_sam_account: struct samu is NULL\n"));
@@ -1196,8 +1197,11 @@
 	}
 
 	/* verify the user account exists */
+
+	fstrcpy( unix_username, pw_buf->smb_name );
+	strlower_m( unix_username );
 			
-	if ( !(pwfile = getpwnam_alloc(NULL, pw_buf->smb_name)) ) {
+	if ( !(pwfile = getpwnam_alloc(NULL, unix_username )) ) {
 		DEBUG(0,("build_sam_account: smbpasswd database is corrupt!  username %s with uid "
 		"%u is not in unix passwd database!\n", pw_buf->smb_name, pw_buf->smb_userid));
 			return False;



More information about the samba-cvs mailing list