From 00c4d9ec1a67c9ed0a9827a9cb2982b335ab7a9a Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 4 Nov 2019 14:17:43 +0100 Subject: [PATCH] smbdotconf: mark "add user to group script" with substitution="1" Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- docs-xml/smbdotconf/logon/addusertogroupscript.xml | 3 ++- source3/groupdb/mapping.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs-xml/smbdotconf/logon/addusertogroupscript.xml b/docs-xml/smbdotconf/logon/addusertogroupscript.xml index d871ead05d2..f6e9cc2d967 100644 --- a/docs-xml/smbdotconf/logon/addusertogroupscript.xml +++ b/docs-xml/smbdotconf/logon/addusertogroupscript.xml @@ -1,6 +1,7 @@ diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index 634f94dc37e..26b5ad0facb 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -357,16 +357,18 @@ int smb_set_primary_group(const char *unix_group, const char* unix_user) int smb_add_user_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_add_user_to_group_script(talloc_tos()) ) { + if ( *lp_add_user_to_group_script(talloc_tos(), lp_sub) ) { TALLOC_CTX *ctx = talloc_tos(); add_script = talloc_strdup(ctx, - lp_add_user_to_group_script(ctx)); + lp_add_user_to_group_script(ctx, lp_sub)); if (!add_script) { return -1; }