diff options
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/ldap/sdap_async_sudo.c | 18 | ||||
-rw-r--r-- | src/providers/ldap/sdap_sudo.c | 6 | ||||
-rw-r--r-- | src/providers/ldap/sdap_sudo_cache.c | 15 | ||||
-rw-r--r-- | src/providers/ldap/sdap_sudo_cache.h | 1 |
4 files changed, 15 insertions, 25 deletions
diff --git a/src/providers/ldap/sdap_async_sudo.c b/src/providers/ldap/sdap_async_sudo.c index 0d4882bd1..b6a5cac75 100644 --- a/src/providers/ldap/sdap_async_sudo.c +++ b/src/providers/ldap/sdap_async_sudo.c @@ -86,15 +86,13 @@ static int sdap_sudo_load_sudoers_recv(struct tevent_req *req, static void sdap_sudo_refresh_load_done(struct tevent_req *subreq); -static int sdap_sudo_purge_sudoers(struct sysdb_ctx *sysdb_ctx, - struct sss_domain_info *dom, +static int sdap_sudo_purge_sudoers(struct sss_domain_info *dom, const char *filter, struct sdap_attr_map *map, size_t rules_count, struct sysdb_attrs **rules); static int sdap_sudo_store_sudoers(TALLOC_CTX *mem_ctx, - struct sysdb_ctx *sysdb_ctx, struct sss_domain_info *domain, struct sdap_options *opts, size_t rules_count, @@ -488,7 +486,7 @@ static void sdap_sudo_refresh_load_done(struct tevent_req *subreq) in_transaction = true; /* purge cache */ - ret = sdap_sudo_purge_sudoers(state->sysdb, state->domain, state->sysdb_filter, + ret = sdap_sudo_purge_sudoers(state->domain, state->sysdb_filter, state->opts->sudorule_map, rules_count, rules); if (ret != EOK) { goto done; @@ -496,7 +494,7 @@ static void sdap_sudo_refresh_load_done(struct tevent_req *subreq) /* store rules */ now = time(NULL); - ret = sdap_sudo_store_sudoers(state, state->sysdb, state->domain, + ret = sdap_sudo_store_sudoers(state, state->domain, state->opts, rules_count, rules, state->domain->sudo_timeout, now, &state->highest_usn); @@ -535,8 +533,7 @@ done: } } -static int sdap_sudo_purge_sudoers(struct sysdb_ctx *sysdb_ctx, - struct sss_domain_info *dom, +static int sdap_sudo_purge_sudoers(struct sss_domain_info *dom, const char *filter, struct sdap_attr_map *map, size_t rules_count, @@ -562,7 +559,7 @@ static int sdap_sudo_purge_sudoers(struct sysdb_ctx *sysdb_ctx, continue; } - ret = sysdb_sudo_purge_byname(sysdb_ctx, dom, name); + ret = sysdb_sudo_purge_byname(dom, name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to delete rule %s: [%s]\n", @@ -574,7 +571,7 @@ static int sdap_sudo_purge_sudoers(struct sysdb_ctx *sysdb_ctx, ret = EOK; } else { /* purge cache by provided filter */ - ret = sysdb_sudo_purge_byfilter(sysdb_ctx, dom, filter); + ret = sysdb_sudo_purge_byfilter(dom, filter); if (ret != EOK) { goto done; } @@ -590,7 +587,6 @@ done: } static int sdap_sudo_store_sudoers(TALLOC_CTX *mem_ctx, - struct sysdb_ctx *sysdb_ctx, struct sss_domain_info *domain, struct sdap_options *opts, size_t rules_count, @@ -606,7 +602,7 @@ static int sdap_sudo_store_sudoers(TALLOC_CTX *mem_ctx, return EOK; } - ret = sdap_save_native_sudorule_list(mem_ctx, sysdb_ctx, domain, + ret = sdap_save_native_sudorule_list(mem_ctx, domain, opts->sudorule_map, rules, rules_count, cache_timeout, now, _usn); diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c index b8bc409ef..9da549ac8 100644 --- a/src/providers/ldap/sdap_sudo.c +++ b/src/providers/ldap/sdap_sudo.c @@ -250,8 +250,7 @@ static int sdap_sudo_setup_periodical_refresh(struct sdap_sudo_ctx *sudo_ctx) } } - ret = sysdb_sudo_get_last_full_refresh(id_ctx->be->domain->sysdb, - id_ctx->be->domain, + ret = sysdb_sudo_get_last_full_refresh(id_ctx->be->domain, &last_full); if (ret != EOK) { return ret; @@ -631,8 +630,7 @@ static void sdap_sudo_full_refresh_done(struct tevent_req *subreq) state->sudo_ctx->full_refresh_done = true; /* save the time in the sysdb */ - ret = sysdb_sudo_set_last_full_refresh(state->sysdb, state->domain, - time(NULL)); + ret = sysdb_sudo_set_last_full_refresh(state->domain, time(NULL)); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to save time of " "a successful full refresh\n")); diff --git a/src/providers/ldap/sdap_sudo_cache.c b/src/providers/ldap/sdap_sudo_cache.c index de4f65c41..c57082c1a 100644 --- a/src/providers/ldap/sdap_sudo_cache.c +++ b/src/providers/ldap/sdap_sudo_cache.c @@ -56,7 +56,6 @@ static errno_t sdap_sudo_get_usn(TALLOC_CTX *mem_ctx, static errno_t sdap_save_native_sudorule(TALLOC_CTX *mem_ctx, - struct sysdb_ctx *sysdb_ctx, struct sss_domain_info *domain, struct sdap_attr_map *map, struct sysdb_attrs *attrs, @@ -94,7 +93,7 @@ sdap_save_native_sudorule(TALLOC_CTX *mem_ctx, /* but we will store the rule anyway */ } - ret = sysdb_save_sudorule(sysdb_ctx, domain, rule_name, attrs); + ret = sysdb_save_sudorule(domain, rule_name, attrs); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, ("Could not save sudorule %s\n", rule_name)); return ret; @@ -105,7 +104,6 @@ sdap_save_native_sudorule(TALLOC_CTX *mem_ctx, errno_t sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx, - struct sysdb_ctx *sysdb_ctx, struct sss_domain_info *domain, struct sdap_attr_map *map, struct sysdb_attrs **replies, @@ -127,17 +125,16 @@ sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx, return ENOMEM; } - ret = sysdb_transaction_start(sysdb_ctx); + ret = sysdb_transaction_start(domain->sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, ("Could not start transaction\n")); goto fail; } in_transaction = true; - for (i=0; i<replies_count; i++) { + for (i=0; i < replies_count; i++) { usn_value = NULL; - ret = sdap_save_native_sudorule(tmp_ctx, sysdb_ctx, - domain, map, replies[i], + ret = sdap_save_native_sudorule(tmp_ctx, domain, map, replies[i], cache_timeout, now, &usn_value); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to save sudo rule, " @@ -161,7 +158,7 @@ sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx, } } - ret = sysdb_transaction_commit(sysdb_ctx); + ret = sysdb_transaction_commit(domain->sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); goto fail; @@ -175,7 +172,7 @@ sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx, ret = EOK; fail: if (in_transaction) { - tret = sysdb_transaction_cancel(sysdb_ctx); + tret = sysdb_transaction_cancel(domain->sysdb); if (tret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); } diff --git a/src/providers/ldap/sdap_sudo_cache.h b/src/providers/ldap/sdap_sudo_cache.h index d156e5cfb..5a756bf31 100644 --- a/src/providers/ldap/sdap_sudo_cache.h +++ b/src/providers/ldap/sdap_sudo_cache.h @@ -26,7 +26,6 @@ /* Cache functions specific for the native sudo LDAP schema */ errno_t sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx, - struct sysdb_ctx *sysdb_ctx, struct sss_domain_info *domain, struct sdap_attr_map *map, struct sysdb_attrs **replies, |