From 678419c0cdd4f83ff3bbe56ff960f15d2fffce20 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 10 May 2011 22:03:20 +0000 Subject: [PATCH] Don't close 0-filedescriptors on session killing, its our indicator for not here, since 0 equals STDIN which at best is redirected to /dev/null --- citadel/context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/citadel/context.c b/citadel/context.c index f4bf0cef4..527828898 100644 --- a/citadel/context.c +++ b/citadel/context.c @@ -357,6 +357,16 @@ void RemoveContext (CitContext *con) syslog(LOG_NOTICE, "[%3d] Session ended.\n", con->cs_pid); + /* + * If the client is still connected, blow 'em away. + * if the socket is 0, its already gone or was never there. + */ + CtdlLogPrintf(CTDL_DEBUG, "Closing socket %d\n", con->client_socket); + if (con->client_socket != 0) + { + close(con->client_socket); + } + /* If using AUTHMODE_LDAP, free the DN */ if (con->ldap_dn) { free(con->ldap_dn); -- 2.30.2