From: Ralph Boehme Date: Tue, 5 Nov 2019 09:59:40 +0000 (+0100) Subject: smbdotconf: mark "message command" with substitution="1" X-Git-Tag: ldb-2.1.0~539 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f47b710b2c97d60d5f8b088a8d8be26c2a1f7d79;p=thirdparty%2Fsamba.git smbdotconf: mark "message command" with substitution="1" Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/docs-xml/smbdotconf/misc/messagecommand.xml b/docs-xml/smbdotconf/misc/messagecommand.xml index 10254527e22..ba39b9f2827 100644 --- a/docs-xml/smbdotconf/misc/messagecommand.xml +++ b/docs-xml/smbdotconf/misc/messagecommand.xml @@ -1,6 +1,7 @@ This specifies what command to run when the diff --git a/source3/smbd/message.c b/source3/smbd/message.c index a4ffad57b5c..b9728946889 100644 --- a/source3/smbd/message.c +++ b/source3/smbd/message.c @@ -43,6 +43,8 @@ struct msg_state { static void msg_deliver(struct msg_state *state) { TALLOC_CTX *frame = talloc_stackframe(); + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); char *name = NULL; int i; int fd; @@ -53,7 +55,7 @@ static void msg_deliver(struct msg_state *state) char *s; mode_t mask; - if (! (*lp_message_command(frame))) { + if (! (*lp_message_command(frame, lp_sub))) { DEBUG(1,("no messaging command specified\n")); goto done; } @@ -100,7 +102,7 @@ static void msg_deliver(struct msg_state *state) close(fd); /* run the command */ - s = lp_message_command(frame); + s = lp_message_command(frame, lp_sub); if (s == NULL) { goto done; } @@ -143,6 +145,8 @@ static void msg_deliver(struct msg_state *state) void reply_sends(struct smb_request *req) { + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); struct msg_state *state; int len; const uint8_t *msg; @@ -150,7 +154,7 @@ void reply_sends(struct smb_request *req) START_PROFILE(SMBsends); - if (!(*lp_message_command(talloc_tos()))) { + if (!(*lp_message_command(talloc_tos(), lp_sub))) { reply_nterror(req, NT_STATUS_REQUEST_NOT_ACCEPTED); END_PROFILE(SMBsends); return; @@ -194,12 +198,14 @@ void reply_sends(struct smb_request *req) void reply_sendstrt(struct smb_request *req) { + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); struct smbXsrv_connection *xconn = req->xconn; const uint8_t *p; START_PROFILE(SMBsendstrt); - if (!(*lp_message_command(talloc_tos()))) { + if (!(*lp_message_command(talloc_tos(), lp_sub))) { reply_nterror(req, NT_STATUS_REQUEST_NOT_ACCEPTED); END_PROFILE(SMBsendstrt); return; @@ -242,6 +248,8 @@ void reply_sendstrt(struct smb_request *req) void reply_sendtxt(struct smb_request *req) { + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); struct smbXsrv_connection *xconn = req->xconn; int len; const char *msg; @@ -250,7 +258,7 @@ void reply_sendtxt(struct smb_request *req) START_PROFILE(SMBsendtxt); - if (! (*lp_message_command(talloc_tos()))) { + if (! (*lp_message_command(talloc_tos(), lp_sub))) { reply_nterror(req, NT_STATUS_REQUEST_NOT_ACCEPTED); END_PROFILE(SMBsendtxt); return; @@ -297,10 +305,12 @@ void reply_sendtxt(struct smb_request *req) void reply_sendend(struct smb_request *req) { + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); struct smbXsrv_connection *xconn = req->xconn; START_PROFILE(SMBsendend); - if (! (*lp_message_command(talloc_tos()))) { + if (! (*lp_message_command(talloc_tos(), lp_sub))) { reply_nterror(req, NT_STATUS_REQUEST_NOT_ACCEPTED); END_PROFILE(SMBsendend); return;