diff options
author | Volker Lendecke <vl@samba.org> | 2012-01-03 22:30:09 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-01-05 13:09:35 +0100 |
commit | f7439f81be83be5836feb8d5050d0e9e616950b3 (patch) | |
tree | cd6a37d6c02e16b75995db0a4781acd04242cbba /source3/smbd | |
parent | 69b51e9053bf808213f9d09cfb8ef50e927dee72 (diff) | |
download | samba-f7439f81be83be5836feb8d5050d0e9e616950b3.tar.gz samba-f7439f81be83be5836feb8d5050d0e9e616950b3.tar.bz2 samba-f7439f81be83be5836feb8d5050d0e9e616950b3.zip |
s3: Add a suicide mode to smbd
To test our cleanup code paths properly, we need a way to make smbd exit hard
without cleaning up
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/process.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index f366600ab8..bf161bbdba 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1412,6 +1412,17 @@ static connection_struct *switch_message(uint8 type, struct smb_request *req, in if ((size < (smb_size - 4)) || !valid_smb_header(sconn, req->inbuf)) { DEBUG(2,("Non-SMB packet of length %d. Terminating server\n", smb_len(req->inbuf))); + + /* special magic for immediate exit */ + if ((size == smb_size) && + (IVAL(req->inbuf, 4) == 0x74697865) && + lp_parm_bool(-1, "smbd", "suicide mode", false)) { + uint8_t exitcode = CVAL(req->inbuf, 8); + DEBUG(1, ("Exiting immediately with code %d\n", + (int)exitcode)); + exit(exitcode); + } + exit_server_cleanly("Non-SMB packet"); } |