From 00c7c1446fcafdff17a032a98b53410a1dbf8894 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Thu, 2 Mar 2017 17:54:46 +0100
Subject: [PATCH] SYSDB: Only search the given domain for UPNs

---
 src/db/sysdb_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 7f6c127..ada5dd5 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -555,7 +555,7 @@ int sysdb_search_user_by_upn_res(TALLOC_CTX *mem_ctx,
         goto done;
     }
 
-    base_dn = sysdb_base_dn(domain->sysdb, tmp_ctx);
+    base_dn = sysdb_user_base_dn(tmp_ctx, domain);
     if (base_dn == NULL) {
         ret = ENOMEM;
         goto done;
