smbdotconf: mark "log nt token command" with substitution="1"
authorRalph Boehme <slow@samba.org>
Tue, 5 Nov 2019 09:52:56 +0000 (10:52 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2019 10:25:35 +0000 (10:25 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
docs-xml/smbdotconf/security/lognttokencommand.xml
source3/auth/auth_util.c

index 66ec6c9e132db76beb16f44bdfd8127abf0af6bd..0ea269e92a12023553be020d20110bf011d3efd6 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="log nt token command"
                  context="G"
                  type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
        <para>This option can be set to a command that will be called when new nt
index f0db42242e9c69e2ab1c392647106413b73c0ce8..9432461d1f817ee566517dafbad4cd087e787a89 100644 (file)
@@ -411,13 +411,15 @@ bool make_user_info_guest(TALLOC_CTX *mem_ctx,
 static NTSTATUS log_nt_token(struct security_token *token)
 {
        TALLOC_CTX *frame = talloc_stackframe();
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        char *command;
        char *group_sidstr;
        struct dom_sid_buf buf;
        size_t i;
 
-       if ((lp_log_nt_token_command(frame) == NULL) ||
-           (strlen(lp_log_nt_token_command(frame)) == 0)) {
+       if ((lp_log_nt_token_command(frame, lp_sub) == NULL) ||
+           (strlen(lp_log_nt_token_command(frame, lp_sub)) == 0)) {
                TALLOC_FREE(frame);
                return NT_STATUS_OK;
        }
@@ -430,7 +432,7 @@ static NTSTATUS log_nt_token(struct security_token *token)
        }
 
        command = talloc_string_sub(
-               frame, lp_log_nt_token_command(frame),
+               frame, lp_log_nt_token_command(frame, lp_sub),
                "%s", dom_sid_str_buf(&token->sids[0], &buf));
        command = talloc_string_sub(frame, command, "%t", group_sidstr);