]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbdotconf: mark "add machine script" with substitution="1"
authorRalph Boehme <slow@samba.org>
Mon, 4 Nov 2019 11:49:10 +0000 (12:49 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2019 10:25:33 +0000 (10:25 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
docs-xml/smbdotconf/logon/addmachinescript.xml
source3/libnet/libnet_dssync_passdb.c
source3/passdb/pdb_interface.c

index 5d88170fc284170e63c7b7dfc58c7cbc19f031eb..db1f5bc98e013d090d0b11727119128ffcdc24bc 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="add machine script"
                  context="G"
-                                type="string"
+                 type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
        <para>
index 4b559f15e7531d669f84186d194184f5ac148b46..dc2700de0e618aaf81b24f8ba11184908ac3d0d3 100644 (file)
@@ -663,6 +663,8 @@ static NTSTATUS smb_create_user(TALLOC_CTX *mem_ctx,
                                const char *account,
                                struct passwd **passwd_p)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        struct passwd *passwd;
        char *add_script = NULL;
 
@@ -678,7 +680,7 @@ static NTSTATUS smb_create_user(TALLOC_CTX *mem_ctx,
        } else if ( (acct_flags & ACB_WSTRUST) ||
                    (acct_flags & ACB_SVRTRUST) ||
                    (acct_flags & ACB_DOMTRUST) ) {
-               add_script = lp_add_machine_script(mem_ctx);
+               add_script = lp_add_machine_script(mem_ctx, lp_sub);
        } else {
                DEBUG(1, ("Unknown user type: %s\n",
                          pdb_encode_acct_ctrl(acct_flags, NEW_PW_FORMAT_SPACE_PADDED_LEN)));
index 556839ae9d1238937e54d6e70b64f25abd76b841..657970d62b9bd7eb8c26ff66a0fff5e582b5a02e 100644 (file)
@@ -447,6 +447,8 @@ static NTSTATUS pdb_default_create_user(struct pdb_methods *methods,
                                        TALLOC_CTX *tmp_ctx, const char *name,
                                        uint32_t acb_info, uint32_t *rid)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        struct samu *sam_pass;
        NTSTATUS status;
        struct passwd *pwd;
@@ -463,7 +465,7 @@ static NTSTATUS pdb_default_create_user(struct pdb_methods *methods,
                if ((acb_info & ACB_NORMAL) && name[strlen(name)-1] != '$') {
                        add_script = lp_add_user_script(tmp_ctx);
                } else {
-                       add_script = lp_add_machine_script(tmp_ctx);
+                       add_script = lp_add_machine_script(tmp_ctx, lp_sub);
                }
 
                if (!add_script || add_script[0] == '\0') {