libcli: Use a define for the SMB_SUICIDE_PACKET
authorAndreas Schneider <asn@samba.org>
Thu, 21 Mar 2019 10:21:21 +0000 (11:21 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 21 Mar 2019 20:38:32 +0000 (20:38 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb/smbXcli_base.c
libcli/smb/smbXcli_base.h
source3/smbd/process.c

index 9105b7c84a41631ee552764eb3b11172c2c8d091..d12e63902d944404b165583a9233e5b0e6b2b5fc 100644 (file)
@@ -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);
 
index a7256490bd12690042a0147684dce2056dfce5eb..a132fbe95afff831971b291c9a1d0c2b228fd5c4 100644 (file)
@@ -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;
index 99693ed1315b98360ca164439b33d061d703b9a2..90cab33a761f9420b53c83f272a8dfe410dd6ffd 100644 (file)
@@ -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",