summaryrefslogtreecommitdiffstats
path: root/source3/passdb/pdb_smbpasswd.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-07-25 21:48:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:22 -0500
commit382b088193154f05c366db4d4ffd8942f963b619 (patch)
tree171de9b2ae291ef8dc4b94fb382f29b442e1032d /source3/passdb/pdb_smbpasswd.c
parent29a4d666bad176483a5a346d24dc1b044bf67b2b (diff)
downloadsamba-382b088193154f05c366db4d4ffd8942f963b619.tar.gz
samba-382b088193154f05c366db4d4ffd8942f963b619.tar.xz
samba-382b088193154f05c366db4d4ffd8942f963b619.zip
r17246: BUG 3964: lower case username prior to getpwnam() call in smbpasswd
(This used to be commit dc4fec1f7d196cf7e18d4dd58149853011380ef9)
Diffstat (limited to 'source3/passdb/pdb_smbpasswd.c')
-rw-r--r--source3/passdb/pdb_smbpasswd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c
index aec1db48b5..c3f190ff30 100644
--- a/source3/passdb/pdb_smbpasswd.c
+++ b/source3/passdb/pdb_smbpasswd.c
@@ -1192,6 +1192,7 @@ static BOOL build_sam_account(struct smbpasswd_privates *smbpasswd_state,
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 @@ static BOOL build_sam_account(struct smbpasswd_privates *smbpasswd_state,
}
/* 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;