]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbdotconf: mark "set primary group script" with substitution="1"
authorRalph Boehme <slow@samba.org>
Tue, 5 Nov 2019 11:00:49 +0000 (12:00 +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/logon/setprimarygroupscript.xml
source3/groupdb/mapping.c

index 60d2cae13250ff0d0bec5333d078dbbd8c43002d..8d1ae366f4485cc4c7de75f148da5ab7b940e73c 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="set primary group script"
                  context="G"
-                                type="string"
+                 type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 
index 7562e997a8ce019b29625a9c2800ddb121802e6a..4a2e17d8bee671d7e9ba7277c1d32ba7a6222207 100644 (file)
@@ -317,16 +317,18 @@ int smb_delete_group(const char *unix_group)
 
 int smb_set_primary_group(const char *unix_group, const char* unix_user)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        char *add_script = NULL;
        int ret = -1;
 
        /* defer to scripts */
 
-       if ( *lp_set_primary_group_script(talloc_tos()) ) {
+       if ( *lp_set_primary_group_script(talloc_tos(), lp_sub) ) {
                TALLOC_CTX *ctx = talloc_tos();
 
                add_script = talloc_strdup(ctx,
-                               lp_set_primary_group_script(ctx));
+                               lp_set_primary_group_script(ctx, lp_sub));
                if (!add_script) {
                        return -1;
                }