summaryrefslogtreecommitdiffstats
path: root/source/nsswitch
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2009-07-18 14:23:24 +0800
committerKarolin Seeger <kseeger@samba.org>2009-07-27 15:55:11 +0200
commitce5f39750eb15dc9aaa2d9def66e449ae146c0c1 (patch)
treebae839eed7bbed35f3dcae4e18bae76453370643 /source/nsswitch
parent3328bbb927231f527c55236f1bee2b5d98b034f7 (diff)
downloadsamba-ce5f39750eb15dc9aaa2d9def66e449ae146c0c1.tar.gz
samba-ce5f39750eb15dc9aaa2d9def66e449ae146c0c1.tar.xz
samba-ce5f39750eb15dc9aaa2d9def66e449ae146c0c1.zip
handling upn
lookupname failed, cannot find domain when attempt to change password. This addresses bug #6560. Signed-off-by: Bo Yang <boyang@samba.org> (cherry picked from commit 830c4da460bcad919421acf9d537cf577b231de7)
Diffstat (limited to 'source/nsswitch')
-rw-r--r--source/nsswitch/pam_winbind.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/nsswitch/pam_winbind.c b/source/nsswitch/pam_winbind.c
index 1211ffd44de..73be3e03f90 100644
--- a/source/nsswitch/pam_winbind.c
+++ b/source/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;
}