diff options
Diffstat (limited to 'src/responder')
-rw-r--r-- | src/responder/pam/pam_LOCAL_domain.c | 28 | ||||
-rw-r--r-- | src/responder/pam/pamsrv_cmd.c | 24 |
2 files changed, 7 insertions, 45 deletions
diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c index a598e77e..80f8a91c 100644 --- a/src/responder/pam/pam_LOCAL_domain.c +++ b/src/responder/pam/pam_LOCAL_domain.c @@ -86,12 +86,10 @@ static void set_user_attr_done(struct tevent_req *req) prepare_reply(lreq); } -static void set_user_attr_req_done(struct tevent_req *subreq); static void set_user_attr_req(struct tevent_req *req) { struct LOCAL_request *lreq = tevent_req_callback_data(req, struct LOCAL_request); - struct tevent_req *subreq; int ret; DEBUG(4, ("entering set_user_attr_req\n")); @@ -102,28 +100,10 @@ static void set_user_attr_req(struct tevent_req *req) return prepare_reply(lreq); } - subreq = sysdb_set_user_attr_send(lreq, lreq->ev, lreq->handle, - lreq->preq->domain, - lreq->preq->pd->user, - lreq->mod_attrs, SYSDB_MOD_REP); - if (!subreq) { - /* cancel transaction */ - talloc_zfree(lreq->handle); - lreq->error = ret; - return prepare_reply(lreq); - } - tevent_req_set_callback(subreq, set_user_attr_req_done, lreq); -} - -static void set_user_attr_req_done(struct tevent_req *subreq) -{ - struct LOCAL_request *lreq = tevent_req_callback_data(subreq, - struct LOCAL_request); - struct tevent_req *req; - int ret; - - ret = sysdb_set_user_attr_recv(subreq); - talloc_zfree(subreq); + ret = sysdb_set_user_attr(lreq, sysdb_handle_get_ctx(lreq->handle), + lreq->preq->domain, + lreq->preq->pd->user, + lreq->mod_attrs, SYSDB_MOD_REP); DEBUG(4, ("set_user_attr_callback, status [%d][%s]\n", ret, strerror(ret))); diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c index 8d67da1b..168efb84 100644 --- a/src/responder/pam/pamsrv_cmd.c +++ b/src/responder/pam/pamsrv_cmd.c @@ -285,7 +285,6 @@ struct set_last_login_state { }; static void set_last_login_trans_done(struct tevent_req *subreq); -static void set_last_login_attrs_done(struct tevent_req *subreq); static void set_last_login_done(struct tevent_req *subreq); static struct tevent_req *set_last_login_send(TALLOC_CTX *memctx, @@ -336,26 +335,9 @@ static void set_last_login_trans_done(struct tevent_req *subreq) return; } - subreq = sysdb_set_user_attr_send(state, state->ev, state->handle, - state->dom, state->username, - state->attrs, SYSDB_MOD_REP); - if (!subreq) { - tevent_req_error(req, ENOMEM); - return; - } - tevent_req_set_callback(subreq, set_last_login_attrs_done, req); -} - -static void set_last_login_attrs_done(struct tevent_req *subreq) -{ - struct tevent_req *req = tevent_req_callback_data(subreq, - struct tevent_req); - struct set_last_login_state *state = tevent_req_data(req, - struct set_last_login_state); - int ret; - - ret = sysdb_set_user_attr_recv(subreq); - talloc_zfree(subreq); + ret = sysdb_set_user_attr(state, sysdb_handle_get_ctx(state->handle), + state->dom, state->username, + state->attrs, SYSDB_MOD_REP); if (ret != EOK) { DEBUG(4, ("set_user_attr_callback, status [%d][%s]\n", ret, strerror(ret))); |