Fix bug 8314] - smbd crash with unknown user.
[samba.git] / source3 / auth / auth_server.c
index 287b50b080ff437edc11b69a9c22c6e38634da82..bc3804115e5fef9b09b17ca5085de83089c008f3 100644 (file)
@@ -273,14 +273,23 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
                                         const auth_usersupplied_info *user_info, 
                                         auth_serversupplied_info **server_info)
 {
-       struct server_security_state *state = talloc_get_type_abort(
-               my_private_data, struct server_security_state);
-       struct cli_state *cli;
+       struct server_security_state *state = NULL;
+       struct cli_state *cli = NULL;
        static bool tested_password_server = False;
        static bool bad_password_server = False;
        NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED;
        bool locally_made_cli = False;
 
+       DEBUG(10, ("check_smbserver_security: Check auth for: [%s]\n",
+               user_info->smb_name));
+
+       if (my_private_data == NULL) {
+               DEBUG(10,("check_smbserver_security: "
+                       "password server is not connected\n"));
+               return NT_STATUS_LOGON_FAILURE;
+       }
+
+       state = talloc_get_type_abort(my_private_data, struct server_security_state);
        cli = state->cli;
        
        if (cli) {