From: Andreas Schneider Date: Wed, 16 Nov 2022 10:24:12 +0000 (+0100) Subject: s3:rpc_server: Fix include directive substitution when enumerating shares X-Git-Tag: talloc-2.4.0~532 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f03665bb7e8ea97699062630f2aa1bac4c5dfc7f;p=thirdparty%2Fsamba.git s3:rpc_server: Fix include directive substitution when enumerating shares BUG: https://bugzilla.samba.org/show_bug.cgi?id=15243 Signed-off-by: Andreas Schneider Reviewed-by: Volker Lendecke Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Fri Nov 18 19:17:31 UTC 2022 on sn-devel-184 --- diff --git a/selftest/knownfail.d/sustitutions b/selftest/knownfail.d/sustitutions deleted file mode 100644 index 800b8e03170..00000000000 --- a/selftest/knownfail.d/sustitutions +++ /dev/null @@ -1 +0,0 @@ -samba3.substitutions.Test.for.share.enum.with.include.substitution diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c index 4fcb7681d84..ed262a8cd0d 100644 --- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c +++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c @@ -650,6 +650,14 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p, added_home = register_homes_share(unix_name); } + /* + * We need to make sure to reload the services for the connecting user. + * It is possible that the we have includes with substitutions. + * + * include = /etc/samba/%U.conf + */ + reload_services(NULL, NULL, false); + num_services = lp_numservices(); allowed = talloc_zero_array(ctx, bool, num_services);