summaryrefslogtreecommitdiffstats
path: root/source3/smbd/server_exit.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-17 12:01:12 +0100
committerStefan Metzmacher <metze@samba.org>2014-02-21 11:48:12 +0100
commit52ccb40d595fc80bfa53b0b9cd75ffb902369681 (patch)
treef2cd180bc20262f1d7a76652720d9325b9ccff31 /source3/smbd/server_exit.c
parent58c71bee40bb91868fc69d8f7fa640db0e33efae (diff)
downloadsamba-52ccb40d595fc80bfa53b0b9cd75ffb902369681.tar.gz
samba-52ccb40d595fc80bfa53b0b9cd75ffb902369681.tar.xz
samba-52ccb40d595fc80bfa53b0b9cd75ffb902369681.zip
s3:smbd: maintain smbd_server_connection->status
If this isn't NT_STATUS_OK, we skip any io on the socket. This avoids possible problems during shutdown. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/smbd/server_exit.c')
-rw-r--r--source3/smbd/server_exit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c
index c656908969..357c69a071 100644
--- a/source3/smbd/server_exit.c
+++ b/source3/smbd/server_exit.c
@@ -102,6 +102,17 @@ static void exit_server_common(enum server_exit_reason how,
if (sconn) {
NTSTATUS status;
+ if (NT_STATUS_IS_OK(sconn->status)) {
+ switch (how) {
+ case SERVER_EXIT_ABNORMAL:
+ sconn->status = NT_STATUS_INTERNAL_ERROR;
+ break;
+ case SERVER_EXIT_NORMAL:
+ sconn->status = NT_STATUS_LOCAL_DISCONNECT;
+ break;
+ }
+ }
+
TALLOC_FREE(sconn->smb1.negprot.auth_context);
if (lp_log_writeable_files_on_exit()) {