summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-11-27 17:21:01 +0100
committerChristian Ambach <ambi@samba.org>2013-12-10 16:39:43 +0100
commit8eef4ab79ec5fb7e96ad2f2ad6c9bf30db13a50d (patch)
treed345237b705819a0e292e7249da3437879ea4d56 /source3/lib
parent7393781a57891687b464762b0954e6c936f750bb (diff)
s3-lib: Fix %G substitution for domain users in smbd
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10286 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Tue Dec 10 16:39:43 CET 2013 on sn-devel-104
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/substitute.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index ca2ac7981f..937f02c499 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -499,10 +499,20 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx,
break;
case 'G' : {
struct passwd *pass;
- r = talloc_strdup(tmp_ctx, smb_name);
+
+ if (domain_name != NULL && domain_name[0] != '\0') {
+ r = talloc_asprintf(tmp_ctx,
+ "%s%c%s",
+ domain_name,
+ *lp_winbind_separator(),
+ smb_name);
+ } else {
+ r = talloc_strdup(tmp_ctx, smb_name);
+ }
if (r == NULL) {
goto error;
}
+
pass = Get_Pwnam_alloc(tmp_ctx, r);
if (pass != NULL) {
a_string = realloc_string_sub(