The Samba-Bugzilla – Attachment 13299 Details for
Bug 12851
'winbind normalize names' doesn't work for users
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.6
0001-s3-winbind-Fix-winbind-normalize-names-in-wb_getpwsi.patch (text/plain), 2.51 KB, created by
Andreas Schneider
on 2017-06-21 08:30:55 UTC
(
hide
)
Description:
patch for 4.6
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2017-06-21 08:30:55 UTC
Size:
2.51 KB
patch
obsolete
>From b44e75bbae39dca672afb63f67cc3f7e41100f8f Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Tue, 20 Jun 2017 10:27:07 +0200 >Subject: [PATCH] s3:winbind: Fix 'winbind normalize names' in wb_getpwsid() > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12851 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Volker Lendecke <vl@samba.org> >(cherry picked from commit 8a2bbba5cd0862ac196739c1e52385f7be1e3836) >--- > source3/winbindd/wb_getpwsid.c | 34 +++++++++++++++++++++++++++++++--- > 1 file changed, 31 insertions(+), 3 deletions(-) > >diff --git a/source3/winbindd/wb_getpwsid.c b/source3/winbindd/wb_getpwsid.c >index 8c764f77b08..b0bf6784ba6 100644 >--- a/source3/winbindd/wb_getpwsid.c >+++ b/source3/winbindd/wb_getpwsid.c >@@ -63,7 +63,9 @@ static void wb_getpwsid_queryuser_done(struct tevent_req *subreq) > req, struct wb_getpwsid_state); > struct winbindd_pw *pw = state->pw; > struct wbint_userinfo *info; >+ struct winbindd_domain *domain = NULL; > fstring acct_name, output_username; >+ char *mapped_name = NULL; > char *tmp; > NTSTATUS status; > >@@ -83,8 +85,34 @@ static void wb_getpwsid_queryuser_done(struct tevent_req *subreq) > return; > } > >- fill_domain_username(output_username, info->domain_name, >- acct_name, true); >+ domain = find_domain_from_name_noinit(info->domain_name); >+ if (tevent_req_nomem(domain, req)) { >+ return; >+ } >+ >+ /* >+ * TODO: >+ * This function should be called in 'idmap winbind child'. It shouldn't >+ * be a blocking call, but for this we need to add a new function for >+ * winbind.idl. This is a fix which can be backported for now. >+ */ >+ status = normalize_name_map(state, >+ domain, >+ acct_name, >+ &mapped_name); >+ if (NT_STATUS_IS_OK(status)) { >+ fill_domain_username(output_username, >+ info->domain_name, >+ mapped_name, true); >+ fstrcpy(acct_name, mapped_name); >+ } else if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_RENAMED)) { >+ fstrcpy(acct_name, mapped_name); >+ } else { >+ fill_domain_username(output_username, >+ info->domain_name, >+ acct_name, true); >+ } >+ > strlcpy(pw->pw_name, output_username, sizeof(pw->pw_name)); > > strlcpy(pw->pw_gecos, info->full_name ? info->full_name : "", >@@ -101,7 +129,7 @@ static void wb_getpwsid_queryuser_done(struct tevent_req *subreq) > TALLOC_FREE(tmp); > > tmp = talloc_sub_specified( >- state, info->shell, info->acct_name, >+ state, info->shell, acct_name, > info->primary_group_name, info->domain_name, > pw->pw_uid, pw->pw_gid); > if (tevent_req_nomem(tmp, req)) { >-- >2.13.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 12851
: 13299 |
14247