r9758: make sure to lower case usernames in winbindd's getpwnam()
authorGerald Carter <jerry@samba.org>
Mon, 29 Aug 2005 21:04:22 +0000 (21:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:03:25 +0000 (11:03 -0500)
(This used to be commit 9fc539088eda7f9b5d212b7df50594bec51e16f5)

source3/nsswitch/winbindd_user.c

index ab5da3edd0637de10bfe07b096a3a9ef6f462228..0b88d5eee5f760893addc799b21cce415f732900 100644 (file)
@@ -230,6 +230,7 @@ static void getpwsid_queryuser_recv(void *private_data, BOOL success,
                                    const char *shell,
                                    uint32 group_rid)
 {
+       fstring username;
        struct getpwsid_state *s =
                talloc_get_type_abort(private_data, struct getpwsid_state);
 
@@ -240,7 +241,9 @@ static void getpwsid_queryuser_recv(void *private_data, BOOL success,
                return;
        }
 
-       s->username = talloc_strdup(s->state->mem_ctx, acct_name);
+       fstrcpy( username, acct_name );
+       strlower_m( username );
+       s->username = talloc_strdup(s->state->mem_ctx, username);
        s->fullname = talloc_strdup(s->state->mem_ctx, full_name);
        s->homedir = talloc_strdup(s->state->mem_ctx, homedir);
        s->shell = talloc_strdup(s->state->mem_ctx, shell);