The Samba-Bugzilla – Attachment 4459 Details for
Bug 6560
winbind cannot handle upn, including 3.2 and 3.3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
for 3.4
upn-v3-4-test-mbox.diff (text/x-patch), 2.36 KB, created by
boyang
on 2009-07-22 21:28:44 UTC
(
hide
)
Description:
for 3.4
Filename:
MIME Type:
Creator:
boyang
Created:
2009-07-22 21:28:44 UTC
Size:
2.36 KB
patch
obsolete
>From b921c46545c7d79d694b6f19bec7d769546f8fb5 Mon Sep 17 00:00:00 2001 >From: Bo Yang <boyang@samba.org> >Date: Thu, 23 Jul 2009 10:23:21 +0800 >Subject: [PATCH] s3: To correctly handle upn > >Signed-off-by: Bo Yang <boyang@samba.org> >--- > nsswitch/pam_winbind.c | 13 ++++++++++++- > source3/winbindd/winbindd_sid.c | 5 +++++ > source3/winbindd/winbindd_util.c | 3 ++- > 3 files changed, 19 insertions(+), 2 deletions(-) > >diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c >index e90f1b7..4a44248 100644 >--- a/nsswitch/pam_winbind.c >+++ b/nsswitch/pam_winbind.c >@@ -2284,6 +2284,7 @@ static char* winbind_upn_to_username(struct pwb_context *ctx, > enum wbcSidType type; > char *domain; > char *name; >+ char *p; > > /* This cannot work when the winbind separator = @ */ > >@@ -2292,9 +2293,19 @@ static char* winbind_upn_to_username(struct pwb_context *ctx, > return NULL; > } > >+ name = talloc_strdup(ctx, upn); >+ if (!name) { >+ return NULL; >+ } >+ >+ if ((p = strchr(name, '@')) != NULL) { >+ *p = 0; >+ domain = p + 1; >+ } >+ > /* Convert the UPN to a SID */ > >- wbc_status = wbcLookupName("", upn, &sid, &type); >+ wbc_status = wbcLookupName(domain, name, &sid, &type); > if (!WBC_ERROR_IS_OK(wbc_status)) { > return NULL; > } >diff --git a/source3/winbindd/winbindd_sid.c b/source3/winbindd/winbindd_sid.c >index 641b18e..b0f2c72 100644 >--- a/source3/winbindd/winbindd_sid.c >+++ b/source3/winbindd/winbindd_sid.c >@@ -93,6 +93,11 @@ void winbindd_lookupname(struct winbindd_cli_state *state) > *p = 0; > name_domain = state->request.data.name.name; > name_user = p+1; >+ } else if ((p = strchr(state->request.data.name.name, '@')) != NULL) { >+ /* upn */ >+ name_domain = p + 1; >+ *p = 0; >+ name_user = state->request.data.name.name; > } else { > name_domain = state->request.data.name.dom_name; > name_user = state->request.data.name.name; >diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c >index a2c1c85..3070c62 100644 >--- a/source3/winbindd/winbindd_util.c >+++ b/source3/winbindd/winbindd_util.c >@@ -1144,7 +1144,8 @@ bool parse_domain_user(const char *domuser, fstring domain, fstring user) > if ( assume_domain(lp_workgroup())) { > fstrcpy(domain, lp_workgroup()); > } else if ((p = strchr(domuser, '@')) != NULL) { >- fstrcpy(domain, ""); >+ fstrcpy(domain, p + 1); >+ user[PTR_DIFF(p, domuser)] = 0; > } else { > return False; > } >-- >1.5.3 >
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
Flags:
vl
:
review+
Actions:
View
Attachments on
bug 6560
:
4437
|
4438
| 4459