From: Andreas Schneider Date: Thu, 21 Mar 2019 10:21:21 +0000 (+0100) Subject: libcli: Use a define for the SMB_SUICIDE_PACKET X-Git-Tag: tdb-1.4.1~655 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3eee4394cb6392f779db3ba9df3a1ab28562a7f3;p=thirdparty%2Fsamba.git libcli: Use a define for the SMB_SUICIDE_PACKET Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 9105b7c84a4..d12e63902d9 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -591,7 +591,7 @@ struct tevent_req *smbXcli_conn_samba_suicide_send(TALLOC_CTX *mem_ctx, return NULL; } state->conn = conn; - SIVAL(state->buf, 4, 0x74697865); + SIVAL(state->buf, 4, SMB_SUICIDE_PACKET); SCVAL(state->buf, 8, exitcode); _smb_setlen_nbt(state->buf, sizeof(state->buf)-4); diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h index a7256490bd1..a132fbe95af 100644 --- a/libcli/smb/smbXcli_base.h +++ b/libcli/smb/smbXcli_base.h @@ -21,6 +21,8 @@ #ifndef _SMBXCLI_BASE_H_ #define _SMBXCLI_BASE_H_ +#define SMB_SUICIDE_PACKET 0x74697865 + struct smbXcli_conn; struct smbXcli_session; struct smbXcli_tcon; diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 99693ed1315..90cab33a761 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -44,6 +44,7 @@ #include "system/threads.h" #include "lib/pthreadpool/pthreadpool_tevent.h" #include "util_event.h" +#include "libcli/smb/smbXcli_base.h" /* Internal message queue for deferred opens. */ struct pending_message_list { @@ -1980,7 +1981,7 @@ static void process_smb(struct smbXsrv_connection *xconn, /* special magic for immediate exit */ if ((nread == 9) && - (IVAL(inbuf, 4) == 0x74697865) && + (IVAL(inbuf, 4) == SMB_SUICIDE_PACKET) && lp_parm_bool(-1, "smbd", "suicide mode", false)) { uint8_t exitcode = CVAL(inbuf, 8); DEBUG(1, ("Exiting immediately with code %d\n",