1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

smbdotconf: mark "add user to group script" with substitution="1"

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Ralph Boehme 2019-11-04 14:17:43 +01:00 committed by Stefan Metzmacher
parent 4c345289ba
commit 00c4d9ec1a
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,7 @@
<samba:parameter name="add user to group script" <samba:parameter name="add user to group script"
context="G" context="G"
type="string" type="string"
substitution="1"
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description> <description>
<para> <para>

View File

@ -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) 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; char *add_script = NULL;
int ret = -1; int ret = -1;
/* defer to scripts */ /* 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(); TALLOC_CTX *ctx = talloc_tos();
add_script = talloc_strdup(ctx, add_script = talloc_strdup(ctx,
lp_add_user_to_group_script(ctx)); lp_add_user_to_group_script(ctx, lp_sub));
if (!add_script) { if (!add_script) {
return -1; return -1;
} }