diff options
Diffstat (limited to 'server/providers/ldap/sdap_async.c')
-rw-r--r-- | server/providers/ldap/sdap_async.c | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c index e618824d..2aba33c1 100644 --- a/server/providers/ldap/sdap_async.c +++ b/server/providers/ldap/sdap_async.c @@ -520,103 +520,6 @@ int sdap_auth_recv(struct tevent_req *req, enum sdap_result *result) return EOK; } -/* ==Password=Caching===================================================== */ - -struct sdap_cache_pw_state { - struct sss_domain_info *domain; - const char *username; - const char *password; - - struct sysdb_req *sysreq; - - int result; -}; - -static void sdap_cache_pw_op(struct sysdb_req *req, void *pvt); -static void sdap_cache_pw_callback(void *pvt, int error, struct ldb_result *r); - -struct tevent_req *sdap_cache_pw_send(TALLOC_CTX *memctx, - struct tevent_context *ev, - struct sysdb_ctx *sysdb, - struct sss_domain_info *domain, - const char *username, - const char *password) -{ - struct tevent_req *req; - struct sdap_cache_pw_state *state; - int ret; - - req = tevent_req_create(memctx, &state, struct sdap_cache_pw_state); - if (!req) return NULL; - - state->domain = domain; - state->username = username; - state->password = password; - - ret = sysdb_transaction(state, sysdb, sdap_cache_pw_op, req); - - if (ret != EOK) { - DEBUG(1, ("Failed to start sysydb transaction (%d)[%s]!?\n", - ret, strerror(ret))); - goto fail; - } - - return req; - -fail: - tevent_req_error(req, EIO); - tevent_req_post(req, ev); - return req; -} - -static void sdap_cache_pw_op(struct sysdb_req *sysreq, void *pvt) -{ - struct tevent_req *req = talloc_get_type(pvt, struct tevent_req); - struct sdap_cache_pw_state *state = tevent_req_data(req, - struct sdap_cache_pw_state); - int ret; - - state->sysreq = sysreq; - - ret = sysdb_set_cached_password(sysreq, - state->domain, - state->username, - state->password, - sdap_cache_pw_callback, req); - if (ret != EOK) { - state->result = ret; - tevent_req_done(req); - } -} - -static void sdap_cache_pw_callback(void *pvt, int e, struct ldb_result *r) -{ - struct tevent_req *req = talloc_get_type(pvt, struct tevent_req); - struct sdap_cache_pw_state *state = tevent_req_data(req, - struct sdap_cache_pw_state); - sysdb_transaction_done(state->sysreq, e); - - if (e != EOK) { - DEBUG(2, ("Failed to cache password (%d)[%s]!?\n", e, strerror(e))); - state->result = e; - } - - state->result = EOK; - tevent_req_done(req); -} - -int sdap_cache_pw_recv(struct tevent_req *req) -{ - struct sdap_cache_pw_state *state = tevent_req_data(req, - struct sdap_cache_pw_state); - enum tevent_req_state tstate; - uint64_t err; - - if (tevent_req_is_error(req, &tstate, &err)) { - return err; - } - return state->result; -} /* ==Save-User-Entry====================================================== */ |