s3:auth make sure we set the right username
[samba.git] / source3 / auth / auth_util.c
index a64fd33db2ed6395549eea5d08c2e1d8e44fb7b7..8ea1f410f10100fb0fb87449868c0d20985f8e08 100644 (file)
@@ -590,6 +590,11 @@ NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info,
                return status;
        }
 
+       /* In pathological cases the above call can set the account
+        * name to the DOMAIN\username form. Reset the account name
+        * using unix_username */
+       pdb_set_username(sampass, unix_username, PDB_SET);
+
        result = make_server_info(NULL);
        if (result == NULL) {
                TALLOC_FREE(sampass);