Merge HEAD: check both the account and password...
[kai/samba.git] / source / auth / auth_sam.c
index 79fded870e99f0d33afabade501fd67db9472538..e2208e145517d305fddcce139fa1bc71996b5dca 100644 (file)
@@ -420,13 +420,13 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
 
        nt_status = sam_account_ok(mem_ctx, sampass, user_info);
        
-       nt_status = sam_password_ok(auth_context, mem_ctx, sampass, user_info, user_sess_key);
-
        if (!NT_STATUS_IS_OK(nt_status)) {
                pdb_free_sam(&sampass);
                return nt_status;
        }
 
+       nt_status = sam_password_ok(auth_context, mem_ctx, sampass, user_info, user_sess_key);
+
        if (!NT_STATUS_IS_OK(nt_status)) {
                pdb_free_sam(&sampass);
                return nt_status;