mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
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
This commit is contained in:
parent
7393781a57
commit
8eef4ab79e
@ -499,10 +499,20 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx,
|
|||||||
break;
|
break;
|
||||||
case 'G' : {
|
case 'G' : {
|
||||||
struct passwd *pass;
|
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) {
|
if (r == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
pass = Get_Pwnam_alloc(tmp_ctx, r);
|
pass = Get_Pwnam_alloc(tmp_ctx, r);
|
||||||
if (pass != NULL) {
|
if (pass != NULL) {
|
||||||
a_string = realloc_string_sub(
|
a_string = realloc_string_sub(
|
||||||
|
Loading…
Reference in New Issue
Block a user