s3:auth Add error paths for invalid password_state values s3compat-auth-changes
authorAndrew Bartlett <abartlet@samba.org>
Tue, 4 May 2010 13:44:50 +0000 (23:44 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 10 Aug 2010 22:42:43 +0000 (08:42 +1000)
source3/auth/auth_server.c
source3/auth/auth_wbc.c
source3/auth/check_samsec.c

index 76cafc6d6900dd1878309794caafb636d2a2744a..b5954e6a4df1cea6617a1df03c1a08c6747c9795 100644 (file)
@@ -410,6 +410,9 @@ use this machine as the password server.\n"));
                        (char *)user_info->password.response.nt.data,
                        user_info->password.response.nt.length,
                        user_info->mapped.domain_name);
+       default:
+               DEBUG(0,("user_info constructed for user '%s' was invalid - password_state=%u invalid.\n",user_info->mapped.account_name, user_info->password_state));
+               nt_status = NT_STATUS_INTERNAL_ERROR;
        }
 
        if (!NT_STATUS_IS_OK(nt_status)) {
index e4fffc7cf88b091ecd0827787094a78733efe8b4..6beec734565b33417363fa317b0963e8610a5e8e 100644 (file)
@@ -95,8 +95,11 @@ static NTSTATUS check_wbc_security(const struct auth_context *auth_context,
                params.password.response.nt_data = user_info->password.response.nt.data;
                params.password.response.lm_length = user_info->password.response.lanman.length;
                params.password.response.lm_data = user_info->password.response.lanman.data;
+       default:
+               DEBUG(0,("user_info constructed for user '%s' was invalid - password_state=%u invalid.\n",user_info->mapped.account_name, user_info->password_state));
+               return NT_STATUS_INTERNAL_ERROR;
        }
-#if 0
+#if 0 /* If ever implemented in libwbclient */
        case AUTH_PASSWORD_HASH:
        {
                DEBUG(3,("Checking logon (hash) password for %s.\n",
index 46e05aa0c2df39e3e6787caf50c8a4970d11b744..3b2f47181297a9729fb56121b54be38384e5b773 100644 (file)
@@ -102,8 +102,10 @@ static NTSTATUS sam_password_ok(TALLOC_CTX *mem_ctx,
                                           lm_hash,
                                           nt_hash,
                                           user_sess_key, lm_sess_key);
+       default:
+               DEBUG(0,("user_info constructed for user '%s' was invalid - password_state=%u invalid.\n", username, user_info->password_state));
+               return NT_STATUS_INTERNAL_ERROR;
        }
-       return NT_STATUS_INVALID_PARAMETER;
 }
 
 /****************************************************************************