From: Jeremy Allison Date: Fri, 22 Jul 2011 23:40:54 +0000 (-0700) Subject: Fix bug 8314] - smbd crash with unknown user. X-Git-Tag: samba-3.5.16~3 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=bbaf9ec54dc80c742a6327d0b037af297a62ef8e Fix bug 8314] - smbd crash with unknown user. All other auth modules code with being called with auth_method->private_data being NULL, make the auth_server module cope with this too. Autobuild-User: Jeremy Allison Autobuild-Date: Sat Jul 23 02:55:01 CEST 2011 on sn-devel-104 (cherry picked from commit 1832c9591099be941ef3afe7b0381c4af61f4728) (cherry picked from commit c352832e2fadf1207cadef525bf21068f1d1ee1b) --- diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c index 287b50b080f..bc3804115e5 100644 --- a/source3/auth/auth_server.c +++ b/source3/auth/auth_server.c @@ -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) {