]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbdotconf: mark "rename user script" with substitution="1"
authorRalph Boehme <slow@samba.org>
Tue, 5 Nov 2019 10:49:28 +0000 (11:49 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2019 10:25:36 +0000 (10:25 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
docs-xml/smbdotconf/security/renameuserscript.xml
source3/passdb/pdb_ldap.c
source3/passdb/pdb_smbpasswd.c
source3/passdb/pdb_tdb.c

index 1a15ebabfefe5cda269b41ebdb0d53b3fbb1abce..2bfbea44c5a1e99b365acbabfa1805c09b9aaa60 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="rename user script"
                  context="G"
                  type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
     <para>
index 22050fa828c96456abb8044bc22435dc5ebdaffa..2aeb62af3c0702510e8853cc2a3a9c64d777b8ea 100644 (file)
@@ -2040,6 +2040,8 @@ static NTSTATUS ldapsam_rename_sam_account(struct pdb_methods *my_methods,
                                           struct samu *old_acct,
                                           const char *newname)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        const char *oldname;
        int rc;
        char *rename_script = NULL;
@@ -2057,7 +2059,7 @@ static NTSTATUS ldapsam_rename_sam_account(struct pdb_methods *my_methods,
        oldname = pdb_get_username(old_acct);
 
        /* rename the posix user */
-       rename_script = lp_rename_user_script(talloc_tos());
+       rename_script = lp_rename_user_script(talloc_tos(), lp_sub);
        if (rename_script == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
index bed3cea744ca75e2e440402dff2127808de9015f..76cfddfb195c5007a634b5b579fc639080a5fc1e 100644 (file)
@@ -1444,13 +1444,15 @@ static NTSTATUS smbpasswd_rename_sam_account (struct pdb_methods *my_methods,
                                              struct samu *old_acct,
                                              const char *newname)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        char *rename_script = NULL;
        struct samu *new_acct = NULL;
        bool interim_account = False;
        TALLOC_CTX *ctx = talloc_tos();
        NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
 
-       if (!*(lp_rename_user_script(talloc_tos())))
+       if (!*(lp_rename_user_script(talloc_tos(), lp_sub)))
                goto done;
 
        if ( !(new_acct = samu_new( NULL )) ) {
@@ -1470,7 +1472,7 @@ static NTSTATUS smbpasswd_rename_sam_account (struct pdb_methods *my_methods,
        interim_account = True;
 
        /* rename the posix user */
-       rename_script = lp_rename_user_script(ctx);
+       rename_script = lp_rename_user_script(ctx, lp_sub);
        if (!rename_script) {
                ret = NT_STATUS_NO_MEMORY;
                goto done;
index 7488d99a94ee2192e94bbf7cb3205f1b240860a8..8b4d84b3704dfed945b2c5bcf264c0f2878b6302 100644 (file)
@@ -1001,6 +1001,8 @@ static NTSTATUS tdbsam_rename_sam_account(struct pdb_methods *my_methods,
                                          struct samu *old_acct,
                                          const char *newname)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        struct samu      *new_acct = NULL;
        char *rename_script = NULL;
        int              rename_ret;
@@ -1013,7 +1015,7 @@ static NTSTATUS tdbsam_rename_sam_account(struct pdb_methods *my_methods,
                return NT_STATUS_NO_MEMORY;
        }
 
-       rename_script = lp_rename_user_script(new_acct);
+       rename_script = lp_rename_user_script(new_acct, lp_sub);
        if (!rename_script) {
                TALLOC_FREE(new_acct);
                return NT_STATUS_NO_MEMORY;