Skip to content

Commit

Permalink
fix detection of authentication against LOCAL domain
Browse files Browse the repository at this point in the history
  • Loading branch information
sumit-bose authored and sgallagher committed Jun 8, 2009
1 parent 345d12e commit eb92196
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server/responder/pam/pamsrv_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,16 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd)
preq->domain = dom;
}

if (preq->domain->provider == NULL) {
DEBUG(1, ("Domain [%s] has no auth provider.\n", preq->domain->name));
ret = EINVAL;
goto done;
}

/* When auth is requested always search the provider first,
* do not rely on cached data unless the provider is completely
* offline */
if (preq->domain->provider &&
if (NEED_CHECK_PROVIDER(preq->domain->provider) &&
(pam_cmd == SSS_PAM_AUTHENTICATE || pam_cmd == SSS_PAM_SETCRED)) {

/* no need to re-check later on */
Expand Down Expand Up @@ -650,7 +656,7 @@ static void pam_check_user_callback(void *ptr, int status,
/* When auth is requested always search the provider first,
* do not rely on cached data unless the provider is
* completely offline */
if (preq->domain->provider &&
if (NEED_CHECK_PROVIDER(preq->domain->provider) &&
(preq->pd->cmd == SSS_PAM_AUTHENTICATE ||
preq->pd->cmd == SSS_PAM_SETCRED)) {

Expand Down Expand Up @@ -728,7 +734,7 @@ static void pam_dom_forwarder(struct pam_auth_req *preq)
preq->pd->domain = preq->domain->name;
}

if (!preq->domain->provider) {
if (!NEED_CHECK_PROVIDER(preq->domain->provider)) {
preq->callback = pam_reply;
ret = LOCAL_pam_handler(preq);
}
Expand Down

0 comments on commit eb92196

Please sign in to comment.