diff options
author | Sumit Bose <sbose@redhat.com> | 2015-10-07 15:22:34 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-10-08 19:56:45 +0200 |
commit | 8ded8b2f4a57d1833fd230307218d8b07a571785 (patch) | |
tree | 9d7be6e10ed734c3c7abbc653b46fbdbeb16fe3b /src | |
parent | 374268c5eda35e8bbc2fef30752299199439cffe (diff) | |
download | sssd-8ded8b2f4a57d1833fd230307218d8b07a571785.tar.gz sssd-8ded8b2f4a57d1833fd230307218d8b07a571785.tar.xz sssd-8ded8b2f4a57d1833fd230307218d8b07a571785.zip |
nss: fix UPN lookups for sub-domain users
Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/db/sysdb_ops.c | 2 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_cmd.c | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 335095bda..ab0d59ca6 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -493,7 +493,7 @@ int sysdb_search_user_by_upn_res(TALLOC_CTX *mem_ctx, goto done; } - base_dn = sysdb_user_base_dn(tmp_ctx, domain); + base_dn = sysdb_base_dn(domain->sysdb, tmp_ctx); if (base_dn == NULL) { ret = ENOMEM; goto done; diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index 3e95a3f5a..4f151b1a1 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -895,7 +895,11 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) name, dom->name); /* if a multidomain search, try with next */ if (cmdctx->check_next) { - dom = get_next_domain(dom, false); + if (cmdctx->name_is_upn) { + dom = get_next_domain(dom, true); + } else { + dom = get_next_domain(dom, false); + } continue; } /* There are no further domains or this was a @@ -970,7 +974,11 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) /* if a multidomain search, try with next */ if (cmdctx->check_next) { - dom = get_next_domain(dom, false); + if (cmdctx->name_is_upn) { + dom = get_next_domain(dom, true); + } else { + dom = get_next_domain(dom, false); + } if (dom) continue; } |