From ae6a8da5bf3cee10ef0e874c1a11861b1bf62d0b Mon Sep 17 00:00:00 2001 From: Isaac Boukris Date: Thu, 22 Feb 2018 11:54:08 +0200 Subject: [PATCH 1/5] wbclient: fix wbcLookupName with UPN According to MS doc, LsaLookupNames supports UPNs, so we shouldn't break the username incorrectly into user and domain. Signed-off-by: Isaac Boukris --- source3/winbindd/winbindd_lookupname.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/source3/winbindd/winbindd_lookupname.c b/source3/winbindd/winbindd_lookupname.c index 1be29fd85c8d..f8b93ec379cb 100644 --- a/source3/winbindd/winbindd_lookupname.c +++ b/source3/winbindd/winbindd_lookupname.c @@ -55,11 +55,6 @@ struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx, *p = 0; domname = request->data.name.name; name = p+1; - } else if ((p = strchr(request->data.name.name, '@')) != NULL) { - /* upn */ - domname = p + 1; - *p = 0; - name = request->data.name.name; } else { domname = request->data.name.dom_name; name = request->data.name.name; From 76dacbe2a883f11364358f49644112c1cf015668 Mon Sep 17 00:00:00 2001 From: Isaac Boukris Date: Thu, 22 Feb 2018 23:39:26 +0000 Subject: [PATCH 2/5] assume our domain on dc too? Signed-off-by: Isaac Boukris --- source3/winbindd/winbindd_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 6292cce9d51d..e842bf7b4773 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -1506,7 +1506,7 @@ struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name) domain = find_domain_from_name_noinit(domain_name); if (domain == NULL) { - return NULL; + return find_our_domain(); } if (domain->secure_channel_type != SEC_CHAN_NULL) { From 74889e5ced8972be0eba0c34af583ffa0ddc4650 Mon Sep 17 00:00:00 2001 From: Isaac Boukris Date: Sun, 25 Feb 2018 23:00:32 +0000 Subject: [PATCH 3/5] Revert "assume our domain on dc too?" This reverts commit 76dacbe2a883f11364358f49644112c1cf015668. --- source3/winbindd/winbindd_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index e842bf7b4773..6292cce9d51d 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -1506,7 +1506,7 @@ struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name) domain = find_domain_from_name_noinit(domain_name); if (domain == NULL) { - return find_our_domain(); + return NULL; } if (domain->secure_channel_type != SEC_CHAN_NULL) { From 69ea47c0a8a3c52b8e25b8c838a9eace974aaf28 Mon Sep 17 00:00:00 2001 From: Isaac Boukris Date: Sun, 25 Feb 2018 23:00:41 +0000 Subject: [PATCH 4/5] Revert "wbclient: fix wbcLookupName with UPN" This reverts commit ae6a8da5bf3cee10ef0e874c1a11861b1bf62d0b. --- source3/winbindd/winbindd_lookupname.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/winbindd/winbindd_lookupname.c b/source3/winbindd/winbindd_lookupname.c index f8b93ec379cb..1be29fd85c8d 100644 --- a/source3/winbindd/winbindd_lookupname.c +++ b/source3/winbindd/winbindd_lookupname.c @@ -55,6 +55,11 @@ struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx, *p = 0; domname = request->data.name.name; name = p+1; + } else if ((p = strchr(request->data.name.name, '@')) != NULL) { + /* upn */ + domname = p + 1; + *p = 0; + name = request->data.name.name; } else { domname = request->data.name.dom_name; name = request->data.name.name; From 22b0f3fdc6dca07a114892466b3cca3fbce5148c Mon Sep 17 00:00:00 2001 From: Isaac Boukris Date: Sun, 25 Feb 2018 23:19:57 +0000 Subject: [PATCH 5/5] wbclient: fix wbcLookupName with UPN LsaLookupNames supports UPN format, avoid breaking it. Signed-off-by: Isaac Boukris --- source3/winbindd/winbindd_lookupname.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source3/winbindd/winbindd_lookupname.c b/source3/winbindd/winbindd_lookupname.c index 1be29fd85c8d..6ca936a8da42 100644 --- a/source3/winbindd/winbindd_lookupname.c +++ b/source3/winbindd/winbindd_lookupname.c @@ -58,7 +58,6 @@ struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx, } else if ((p = strchr(request->data.name.name, '@')) != NULL) { /* upn */ domname = p + 1; - *p = 0; name = request->data.name.name; } else { domname = request->data.name.dom_name;