diff options
author | Simo Sorce <simo@redhat.com> | 2013-01-06 17:54:02 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-15 10:49:20 +0100 |
commit | 5d78919c955c945e78865f322726aac075c71203 (patch) | |
tree | d351a11ffe460d1e7a32a6b1d629a1f62eb792b1 /src/providers/krb5 | |
parent | c3ca06c011a34997cd6ec5d1e5927fee12bf2464 (diff) | |
download | sssd-5d78919c955c945e78865f322726aac075c71203.tar.gz sssd-5d78919c955c945e78865f322726aac075c71203.tar.bz2 sssd-5d78919c955c945e78865f322726aac075c71203.zip |
Add domain argument to sysdb_get_user_attr()
Diffstat (limited to 'src/providers/krb5')
-rw-r--r-- | src/providers/krb5/krb5_access.c | 4 | ||||
-rw-r--r-- | src/providers/krb5/krb5_auth.c | 14 | ||||
-rw-r--r-- | src/providers/krb5/krb5_utils.c | 3 | ||||
-rw-r--r-- | src/providers/krb5/krb5_utils.h | 1 |
4 files changed, 12 insertions, 10 deletions
diff --git a/src/providers/krb5/krb5_access.c b/src/providers/krb5/krb5_access.c index 970633eb..41e62d36 100644 --- a/src/providers/krb5/krb5_access.c +++ b/src/providers/krb5/krb5_access.c @@ -88,8 +88,8 @@ struct tevent_req *krb5_access_send(TALLOC_CTX *mem_ctx, attrs[2] = SYSDB_GIDNUM; attrs[3] = NULL; - ret = sysdb_get_user_attr(state, be_ctx->sysdb, state->pd->user, attrs, - &res); + ret = sysdb_get_user_attr(state, be_ctx->sysdb, be_ctx->domain, + state->pd->user, attrs, &res); if (ret) { DEBUG(5, ("sysdb search for upn of user [%s] failed.\n", pd->user)); goto done; diff --git a/src/providers/krb5/krb5_auth.c b/src/providers/krb5/krb5_auth.c index 398f06a8..f03cfcf4 100644 --- a/src/providers/krb5/krb5_auth.c +++ b/src/providers/krb5/krb5_auth.c @@ -429,6 +429,7 @@ struct krb5_auth_state { struct be_ctx *be_ctx; struct pam_data *pd; struct sysdb_ctx *sysdb; + struct sss_domain_info *domain; struct krb5_ctx *krb5_ctx; struct krb5child_req *kr; @@ -456,7 +457,6 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, struct tevent_req *req; struct tevent_req *subreq; int ret; - struct sss_domain_info *dom; req = tevent_req_create(mem_ctx, &state, struct krb5_auth_state); if (req == NULL) { @@ -472,13 +472,13 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, state->pam_status = PAM_SYSTEM_ERR; state->dp_err = DP_ERR_FATAL; - ret = get_domain_or_subdomain(state, be_ctx, pd->domain, &dom); + ret = get_domain_or_subdomain(state, be_ctx, pd->domain, &state->domain); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("get_domain_or_subdomain failed.\n")); goto done; } - state->sysdb = dom->sysdb; + state->sysdb = state->domain->sysdb; switch (pd->cmd) { case SSS_PAM_AUTHENTICATE: @@ -541,8 +541,8 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, } kr = state->kr; - ret = sysdb_get_user_attr(state, state->sysdb, state->pd->user, attrs, - &res); + ret = sysdb_get_user_attr(state, state->sysdb, state->domain, + state->pd->user, attrs, &res); if (ret) { DEBUG(5, ("sysdb search for upn of user [%s] failed.\n", pd->user)); state->pam_status = PAM_SYSTEM_ERR; @@ -901,8 +901,8 @@ static void krb5_auth_done(struct tevent_req *subreq) goto done; } - ret = check_if_cached_upn_needs_update(state->sysdb, pd->user, - res->correct_upn); + ret = check_if_cached_upn_needs_update(state->sysdb, state->domain, + pd->user, res->correct_upn); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("check_if_cached_upn_needs_update failed.\n")); diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c index f99b0f99..b770714b 100644 --- a/src/providers/krb5/krb5_utils.c +++ b/src/providers/krb5/krb5_utils.c @@ -58,6 +58,7 @@ errno_t find_or_guess_upn(TALLOC_CTX *mem_ctx, struct ldb_message *msg, } errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, const char *user, const char *upn) { @@ -80,7 +81,7 @@ errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb, return ENOMEM; } - ret = sysdb_get_user_attr(tmp_ctx, sysdb, user, attrs, &res); + ret = sysdb_get_user_attr(tmp_ctx, sysdb, domain, user, attrs, &res); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("sysdb_get_user_attr failed.\n")); goto done; diff --git a/src/providers/krb5/krb5_utils.h b/src/providers/krb5/krb5_utils.h index 25d8c6cf..a123a795 100644 --- a/src/providers/krb5/krb5_utils.h +++ b/src/providers/krb5/krb5_utils.h @@ -38,6 +38,7 @@ errno_t find_or_guess_upn(TALLOC_CTX *mem_ctx, struct ldb_message *msg, const char *user_dom, char **_upn); errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, const char *user, const char *upn); |