summaryrefslogtreecommitdiff
path: root/server/responder
diff options
context:
space:
mode:
Diffstat (limited to 'server/responder')
-rw-r--r--server/responder/nss/nsssrv_cmd.c43
-rw-r--r--server/responder/pam/pam_LOCAL_domain.c2
2 files changed, 14 insertions, 31 deletions
diff --git a/server/responder/nss/nsssrv_cmd.c b/server/responder/nss/nsssrv_cmd.c
index f5555ed9..ba444ccf 100644
--- a/server/responder/nss/nsssrv_cmd.c
+++ b/server/responder/nss/nsssrv_cmd.c
@@ -347,7 +347,7 @@ static void nss_cmd_getpwnam_callback(void *ptr, int status,
cmdctx->name));
ret = ENOENT;
}
- if (dctx->domain == NULL) {
+ if (dom == NULL) {
DEBUG(2, ("No matching domain found for [%s], fail!\n",
cmdctx->name));
ret = ENOENT;
@@ -696,31 +696,22 @@ static void nss_cmd_getpwuid_callback(void *ptr, int status,
ret = EOK;
- for (dom = dctx->domain->next; dom; dom = dom->next) {
-
- ncret = nss_ncache_check_uid(nctx->ncache, nctx->neg_timeout,
+ dom = dctx->domain->next;
+ ncret = nss_ncache_check_uid(nctx->ncache, nctx->neg_timeout,
cmdctx->id);
- if (ncret == ENOENT) break;
-
- neghit = true;
- }
- /* reset neghit if we still have a domain to check */
- if (dom) neghit = false;
-
- dctx->domain = dom;
-
- if (neghit) {
+ if (ncret == EEXIST) {
DEBUG(3, ("Uid [%lu] does not exist! (negative cache)\n",
(unsigned long)cmdctx->id));
ret = ENOENT;
}
- if (dctx->domain == NULL) {
+ if (dom == NULL) {
DEBUG(0, ("No matching domain found for [%lu], fail!\n",
(unsigned long)cmdctx->id));
ret = ENOENT;
}
if (ret == EOK) {
+ dctx->domain = dom;
dctx->check_provider = (dctx->domain->provider != NULL);
if (dctx->res) talloc_free(res);
dctx->res = NULL;
@@ -1723,7 +1714,7 @@ static void nss_cmd_getgrnam_callback(void *ptr, int status,
cmdctx->name));
ret = ENOENT;
}
- if (dctx->domain == NULL) {
+ if (dom == NULL) {
DEBUG(2, ("No matching domain found for [%s], fail!\n",
cmdctx->name));
ret = ENOENT;
@@ -2057,31 +2048,23 @@ static void nss_cmd_getgrgid_callback(void *ptr, int status,
ret = EOK;
- for (dom = dctx->domain->next; dom; dom = dom->next) {
-
- ncret = nss_ncache_check_gid(nctx->ncache, nctx->neg_timeout,
- cmdctx->id);
- if (ncret == ENOENT) break;
+ dom = dctx->domain->next;
- neghit = true;
- }
- /* reset neghit if we still have a domain to check */
- if (dom) neghit = false;
-
- dctx->domain = dom;
-
- if (neghit) {
+ ncret = nss_ncache_check_gid(nctx->ncache, nctx->neg_timeout,
+ cmdctx->id);
+ if (ncret == EEXIST) {
DEBUG(3, ("Gid [%lu] does not exist! (negative cache)\n",
(unsigned long)cmdctx->id));
ret = ENOENT;
}
- if (dctx->domain == NULL) {
+ if (dom == NULL) {
DEBUG(0, ("No matching domain found for [%lu], fail!\n",
(unsigned long)cmdctx->id));
ret = ENOENT;
}
if (ret == EOK) {
+ dctx->domain = dom;
dctx->check_provider = (dctx->domain->provider != NULL);
if (dctx->res) talloc_free(res);
dctx->res = NULL;
diff --git a/server/responder/pam/pam_LOCAL_domain.c b/server/responder/pam/pam_LOCAL_domain.c
index df2803e5..dc394ab8 100644
--- a/server/responder/pam/pam_LOCAL_domain.c
+++ b/server/responder/pam/pam_LOCAL_domain.c
@@ -407,7 +407,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq)
ret = sysdb_get_user_attr(lreq, lreq->dbctx,
preq->domain, preq->pd->user, attrs,
- local_handler_callback, preq);
+ local_handler_callback, lreq);
if (ret != EOK) {
DEBUG(1, ("sysdb_get_user_attr failed.\n"));