summaryrefslogtreecommitdiff
path: root/src/responder/pam
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-14 17:04:00 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-02-10 22:08:47 +0100
commit0232747f04b650796db56fd7b487aee8a96fab03 (patch)
tree0c0329a59cbb66b1e4ea4983cd034dc9015245dc /src/responder/pam
parent95e94691178297f2b8225a83d43ae388cab04b45 (diff)
downloadsssd-0232747f04b650796db56fd7b487aee8a96fab03.tar.gz
sssd-0232747f04b650796db56fd7b487aee8a96fab03.tar.bz2
sssd-0232747f04b650796db56fd7b487aee8a96fab03.zip
Add function get_next_domain()
Use this function instead of explicitly calling domain->next This function allows to get the next primary domain or to descend into the subdomains and replaces also get_next_dom_or_subdom()
Diffstat (limited to 'src/responder/pam')
-rw-r--r--src/responder/pam/pamsrv_cmd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index dd3637b0..d7850efa 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -1088,7 +1088,9 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd)
goto done;
}
} else {
- for (dom = preq->cctx->rctx->domains; dom; dom = dom->next) {
+ for (dom = preq->cctx->rctx->domains;
+ dom;
+ dom = get_next_domain(dom, false)) {
if (dom->fqnames) continue;
ncret = sss_ncache_check_user(pctx->ncache, pctx->neg_timeout,
@@ -1186,7 +1188,7 @@ static int pam_check_user_search(struct pam_auth_req *preq)
/* if it is a domainless search, skip domains that require fully
* qualified names instead */
while (dom && !preq->pd->domain && dom->fqnames) {
- dom = dom->next;
+ dom = get_next_domain(dom, false);
}
if (!dom) break;
@@ -1248,7 +1250,7 @@ static int pam_check_user_search(struct pam_auth_req *preq)
if (preq->res->count == 0) {
/* if a multidomain search, try with next */
if (!preq->pd->domain) {
- dom = dom->next;
+ dom = get_next_domain(dom, false);
continue;
}