From 33e6af5b3d8db3e0c4a7eabacf3be1c849805c84 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Nov 2003 19:33:42 +0000 Subject: [PATCH] Patch from Andrew Bartlett for security=server core dump if server goes away. Jeremy. (This used to be commit e61324cc6a222ca714530827068104f7a74c0911) --- source3/auth/auth_server.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c index 30e0e13a56e..b57293943c0 100644 --- a/source3/auth/auth_server.c +++ b/source3/auth/auth_server.c @@ -153,14 +153,16 @@ static void free_server_private_data(void **private_data_pointer) static void send_server_keepalive(void **private_data_pointer) { - struct cli_state **cli = (struct cli_state **)private_data_pointer; - /* also send a keepalive to the password server if its still connected */ - if (cli && *cli && (*cli)->initialised) { - if (!send_keepalive((*cli)->fd)) { - DEBUG( 2, ( "password server keepalive failed.\n")); - cli_shutdown(*cli); + if (private_data_pointer) { + struct cli_state *cli = (struct cli_state *)(*private_data_pointer); + if (cli && cli->initialised) { + if (!send_keepalive(cli->fd)) { + DEBUG( 2, ( "send_server_keepalive: password server keepalive failed.\n")); + cli_shutdown(cli); + *private_data_pointer = NULL; + } } } }