diff --git a/docs-xml/smbdotconf/logon/addmachinescript.xml b/docs-xml/smbdotconf/logon/addmachinescript.xml index 5d88170fc28..db1f5bc98e0 100644 --- a/docs-xml/smbdotconf/logon/addmachinescript.xml +++ b/docs-xml/smbdotconf/logon/addmachinescript.xml @@ -1,6 +1,7 @@ diff --git a/source3/libnet/libnet_dssync_passdb.c b/source3/libnet/libnet_dssync_passdb.c index 4b559f15e75..dc2700de0e6 100644 --- a/source3/libnet/libnet_dssync_passdb.c +++ b/source3/libnet/libnet_dssync_passdb.c @@ -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))); diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 556839ae9d1..657970d62b9 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -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') {