diff options
author | Simo Sorce <simo@redhat.com> | 2013-01-07 17:09:16 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-15 10:49:20 +0100 |
commit | 3f94d6718d44185137e13b6d326dfd63e8dc61c6 (patch) | |
tree | 575f6c8f1e169b326fabceda2622e370794d2bb0 /src/responder/pam | |
parent | e6f266656ead48452673389835125db7a1a34baf (diff) | |
download | sssd-3f94d6718d44185137e13b6d326dfd63e8dc61c6.tar.gz sssd-3f94d6718d44185137e13b6d326dfd63e8dc61c6.tar.bz2 sssd-3f94d6718d44185137e13b6d326dfd63e8dc61c6.zip |
Add domain argument to sysdb_set_user_attr()
Diffstat (limited to 'src/responder/pam')
-rw-r--r-- | src/responder/pam/pam_LOCAL_domain.c | 11 | ||||
-rw-r--r-- | src/responder/pam/pamsrv_cmd.c | 11 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c index a903fea9..72ea61e8 100644 --- a/src/responder/pam/pam_LOCAL_domain.c +++ b/src/responder/pam/pam_LOCAL_domain.c @@ -49,6 +49,7 @@ struct LOCAL_request { struct tevent_context *ev; struct sysdb_ctx *dbctx; + struct sss_domain_info *domain; struct sysdb_attrs *mod_attrs; struct ldb_result *res; @@ -86,7 +87,8 @@ static void do_successful_login(struct LOCAL_request *lreq) NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_attrs_add_long failed.\n"), lreq->error, ret, done); - ret = sysdb_set_user_attr(lreq->dbctx, lreq->preq->pd->user, + ret = sysdb_set_user_attr(lreq->dbctx, lreq->domain, + lreq->preq->pd->user, lreq->mod_attrs, SYSDB_MOD_REP); NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_set_user_attr failed.\n"), lreq->error, ret, done); @@ -126,7 +128,8 @@ static void do_failed_login(struct LOCAL_request *lreq) NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_attrs_add_long failed.\n"), lreq->error, ret, done); - ret = sysdb_set_user_attr(lreq->dbctx, lreq->preq->pd->user, + ret = sysdb_set_user_attr(lreq->dbctx, lreq->domain, + lreq->preq->pd->user, lreq->mod_attrs, SYSDB_MOD_REP); NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_set_user_attr failed.\n"), lreq->error, ret, done); @@ -194,7 +197,8 @@ static void do_pam_chauthtok(struct LOCAL_request *lreq) NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_attrs_add_long failed.\n"), lreq->error, ret, done); - ret = sysdb_set_user_attr(lreq->dbctx, lreq->preq->pd->user, + ret = sysdb_set_user_attr(lreq->dbctx, lreq->domain, + lreq->preq->pd->user, lreq->mod_attrs, SYSDB_MOD_REP); NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_set_user_attr failed.\n"), lreq->error, ret, done); @@ -238,6 +242,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) talloc_free(lreq); return ENOENT; } + lreq->domain = preq->domain; lreq->ev = preq->cctx->ev; lreq->preq = preq; diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c index fa8eabf6..6fe216db 100644 --- a/src/responder/pam/pamsrv_cmd.c +++ b/src/responder/pam/pamsrv_cmd.c @@ -335,7 +335,6 @@ static int pam_parse_in_data(struct sss_domain_info *domains, static errno_t set_last_login(struct pam_auth_req *preq) { - struct sysdb_ctx *dbctx; struct sysdb_attrs *attrs; errno_t ret; @@ -355,14 +354,8 @@ static errno_t set_last_login(struct pam_auth_req *preq) goto fail; } - dbctx = preq->domain->sysdb; - if (dbctx == NULL) { - DEBUG(0, ("Fatal: Sysdb context not found for this domain!\n")); - ret = EINVAL; - goto fail; - } - - ret = sysdb_set_user_attr(dbctx, preq->pd->user, attrs, SYSDB_MOD_REP); + ret = sysdb_set_user_attr(preq->domain->sysdb, preq->domain, + preq->pd->user, attrs, SYSDB_MOD_REP); if (ret != EOK) { DEBUG(2, ("set_last_login failed.\n")); preq->pd->pam_status = PAM_SYSTEM_ERR; |