From ac3a1f3da772cf101101c31675c63dc3549b21b5 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 31 Oct 2011 12:43:12 +0100 Subject: Cleanup: Remove unused parameters --- src/providers/ldap/ldap_auth.c | 3 +-- src/providers/ldap/ldap_id_cleanup.c | 9 +++------ src/providers/ldap/sdap.c | 2 -- src/providers/ldap/sdap.h | 2 -- src/providers/ldap/sdap_access.c | 15 ++------------- src/providers/ldap/sdap_async.c | 3 ++- src/providers/ldap/sdap_async_connection.c | 14 +++++--------- src/providers/ldap/sdap_async_groups.c | 18 ++++++------------ src/providers/ldap/sdap_async_initgroups.c | 23 +++++++---------------- src/providers/ldap/sdap_async_netgroups.c | 5 +---- 10 files changed, 27 insertions(+), 67 deletions(-) (limited to 'src/providers/ldap') diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c index df455793..f58d52fe 100644 --- a/src/providers/ldap/ldap_auth.c +++ b/src/providers/ldap/ldap_auth.c @@ -341,7 +341,6 @@ shadow_fail: static int get_user_dn(TALLOC_CTX *memctx, struct sysdb_ctx *sysdb, struct sdap_options *opts, - struct sss_domain_info *dom, const char *username, char **user_dn, enum pwexpire *user_pw_expire_type, @@ -604,7 +603,7 @@ static void auth_connect_done(struct tevent_req *subreq) } ret = get_user_dn(state, state->ctx->be->sysdb, state->ctx->opts, - state->ctx->be->domain, state->username, &state->dn, + state->username, &state->dn, &state->pw_expire_type, &state->pw_expire_data); if (ret) { tevent_req_error(req, ret); diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c index 9c50ee48..27a86b9f 100644 --- a/src/providers/ldap/ldap_id_cleanup.c +++ b/src/providers/ldap/ldap_id_cleanup.c @@ -171,8 +171,7 @@ struct global_cleanup_state { static int cleanup_users(TALLOC_CTX *memctx, struct sdap_id_ctx *ctx); static int cleanup_groups(TALLOC_CTX *memctx, - struct sysdb_ctx *sysdb, - struct sss_domain_info *domain); + struct sysdb_ctx *sysdb); struct tevent_req *ldap_id_cleanup_send(TALLOC_CTX *memctx, struct tevent_context *ev, @@ -203,8 +202,7 @@ struct tevent_req *ldap_id_cleanup_send(TALLOC_CTX *memctx, } ret = cleanup_groups(state, - state->ctx->be->sysdb, - state->ctx->be->domain); + state->ctx->be->sysdb); if (ret) { goto fail; } @@ -379,8 +377,7 @@ static int cleanup_users_logged_in(hash_table_t *table, /* ==Group-Cleanup-Process================================================ */ static int cleanup_groups(TALLOC_CTX *memctx, - struct sysdb_ctx *sysdb, - struct sss_domain_info *domain) + struct sysdb_ctx *sysdb) { TALLOC_CTX *tmpctx; const char *attrs[] = { SYSDB_NAME, SYSDB_GIDNUM, NULL }; diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index c3f507bb..373bd4d2 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -281,7 +281,6 @@ int sdap_parse_group(TALLOC_CTX *memctx, struct sdap_options *opts, errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, struct sdap_attr_map_info *minfo, size_t num_maps, - struct sdap_handle *sh, LDAPDerefRes *dref, struct sdap_deref_attrs ***_res) { @@ -733,7 +732,6 @@ done: } errno_t sdap_set_config_options_with_rootdse(struct sysdb_attrs *rootdse, - struct sdap_handle *sh, struct sdap_options *opts) { int ret; diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h index b32560a8..c8eb9281 100644 --- a/src/providers/ldap/sdap.h +++ b/src/providers/ldap/sdap.h @@ -357,7 +357,6 @@ int sdap_parse_group(TALLOC_CTX *memctx, struct sdap_options *opts, errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, struct sdap_attr_map_info *minfo, size_t num_maps, - struct sdap_handle *sh, LDAPDerefRes *dref, struct sdap_deref_attrs ***_res); @@ -387,7 +386,6 @@ int sdap_control_create(struct sdap_handle *sh, const char *oid, int iscritical, struct berval *value, int dupval, LDAPControl **ctrlp); errno_t sdap_set_config_options_with_rootdse(struct sysdb_attrs *rootdse, - struct sdap_handle *sh, struct sdap_options *opts); int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx, const char *server, diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c index 9f10a146..287ba125 100644 --- a/src/providers/ldap/sdap_access.c +++ b/src/providers/ldap/sdap_access.c @@ -71,7 +71,6 @@ static void sdap_access_filter_done(struct tevent_req *subreq); static struct tevent_req *sdap_account_expired_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct be_ctx *be_ctx, struct sdap_access_ctx *access_ctx, struct pam_data *pd, struct ldb_message *user_entry); @@ -82,7 +81,6 @@ static void sdap_access_service_done(struct tevent_req *subreq); static struct tevent_req *sdap_access_service_send( TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct sdap_access_ctx *access_ctx, struct pam_data *pd, struct ldb_message *user_entry); @@ -95,8 +93,6 @@ static void sdap_access_host_done(struct tevent_req *subreq); static struct tevent_req *sdap_access_host_send( TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct sdap_access_ctx *access_ctx, - struct pam_data *pd, struct ldb_message *user_entry); static void sdap_access_done(struct tevent_req *req); @@ -247,7 +243,7 @@ static errno_t select_next_rule(struct tevent_req *req) return EOK; case LDAP_ACCESS_EXPIRE: - subreq = sdap_account_expired_send(state, state->ev, state->be_ctx, + subreq = sdap_account_expired_send(state, state->ev, state->access_ctx, state->pd, state->user_entry); @@ -261,7 +257,6 @@ static errno_t select_next_rule(struct tevent_req *req) case LDAP_ACCESS_SERVICE: subreq = sdap_access_service_send(state, state->ev, - state->access_ctx, state->pd, state->user_entry); if (subreq == NULL) { @@ -273,9 +268,7 @@ static errno_t select_next_rule(struct tevent_req *req) case LDAP_ACCESS_HOST: subreq = sdap_access_host_send(state, state->ev, - state->access_ctx, - state->pd, - state->user_entry); + state->user_entry); if (subreq == NULL) { DEBUG(1, ("sdap_access_host_send failed.\n")); return ENOMEM; @@ -645,7 +638,6 @@ struct sdap_account_expired_req_ctx { static struct tevent_req *sdap_account_expired_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct be_ctx *be_ctx, struct sdap_access_ctx *access_ctx, struct pam_data *pd, struct ldb_message *user_entry) @@ -1126,7 +1118,6 @@ struct sdap_access_service_ctx { static struct tevent_req *sdap_access_service_send( TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct sdap_access_ctx *access_ctx, struct pam_data *pd, struct ldb_message *user_entry) { @@ -1260,8 +1251,6 @@ struct sdap_access_host_ctx { static struct tevent_req *sdap_access_host_send( TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct sdap_access_ctx *access_ctx, - struct pam_data *pd, struct ldb_message *user_entry) { errno_t ret; diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c index a1355f93..b1177e27 100644 --- a/src/providers/ldap/sdap_async.c +++ b/src/providers/ldap/sdap_async.c @@ -933,6 +933,7 @@ sdap_get_generic_ext_send(TALLOC_CTX *memctx, state->attrs = attrs; state->attrsonly = attrsonly; state->op = NULL; + state->sizelimit = sizelimit; state->timeout = timeout; state->cookie.bv_len = 0; state->cookie.bv_val = NULL; @@ -1452,7 +1453,7 @@ static errno_t sdap_x_deref_parse_entry(struct sdap_handle *sh, for (dref = deref_res; dref; dref=dref->next) { ret = sdap_parse_deref(tmp_ctx, state->maps, state->num_maps, - state->sh, dref, &res); + dref, &res); if (ret) { DEBUG(SSSDBG_OP_FAILURE, ("sdap_parse_deref failed [%d]: %s\n", ret, strerror(ret))); diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c index cb732536..dfec3548 100644 --- a/src/providers/ldap/sdap_async_connection.c +++ b/src/providers/ldap/sdap_async_connection.c @@ -982,8 +982,7 @@ struct sdap_auth_state { }; static void sdap_auth_done(struct tevent_req *subreq); -static int sdap_auth_get_authtok(TALLOC_CTX *memctx, - const char *authtok_type, +static int sdap_auth_get_authtok(const char *authtok_type, struct dp_opt_blob authtok, struct berval *pw); @@ -1006,7 +1005,7 @@ struct tevent_req *sdap_auth_send(TALLOC_CTX *memctx, state->user_dn = user_dn; - ret = sdap_auth_get_authtok(state, authtok_type, authtok, &state->pw); + ret = sdap_auth_get_authtok(authtok_type, authtok, &state->pw); if (ret != EOK) { if (ret == ENOSYS) { DEBUG(1, ("Getting authtok is not supported with the " @@ -1039,8 +1038,7 @@ struct tevent_req *sdap_auth_send(TALLOC_CTX *memctx, return req; } -static int sdap_auth_get_authtok(TALLOC_CTX *mem_ctx, - const char *authtok_type, +static int sdap_auth_get_authtok(const char *authtok_type, struct dp_opt_blob authtok, struct berval *pw) { @@ -1353,8 +1351,7 @@ static void sdap_cli_rootdse_done(struct tevent_req *subreq) return; } - ret = sdap_set_config_options_with_rootdse(rootdse, state->sh, - state->opts); + ret = sdap_set_config_options_with_rootdse(rootdse, state->opts); if (ret) { DEBUG(1, ("sdap_set_config_options_with_rootdse failed.\n")); tevent_req_error(req, ret); @@ -1680,8 +1677,7 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, user_dn = dp_opt_get_string(p->opts->basic, SDAP_DEFAULT_BIND_DN); if (user_dn != NULL) { - ret = sdap_auth_get_authtok(tmp_ctx, - dp_opt_get_string(p->opts->basic, + ret = sdap_auth_get_authtok(dp_opt_get_string(p->opts->basic, SDAP_DEFAULT_AUTHTOK_TYPE), dp_opt_get_blob(p->opts->basic, SDAP_DEFAULT_AUTHTOK), diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c index 25a3e0a5..11f6b5c7 100644 --- a/src/providers/ldap/sdap_async_groups.c +++ b/src/providers/ldap/sdap_async_groups.c @@ -178,9 +178,7 @@ done: /* FIXME: support storing additional attributes */ static errno_t -sdap_store_group_with_gid(TALLOC_CTX *mem_ctx, - struct sysdb_ctx *ctx, - struct sss_domain_info *domain, +sdap_store_group_with_gid(struct sysdb_ctx *ctx, const char *name, gid_t gid, struct sysdb_attrs *group_attrs, @@ -387,7 +385,7 @@ static int sdap_save_group(TALLOC_CTX *memctx, DEBUG(6, ("Storing info for group %s\n", name)); - ret = sdap_store_group_with_gid(group_attrs, ctx, dom, + ret = sdap_store_group_with_gid(ctx, name, gid, group_attrs, dp_opt_get_int(opts->basic, SDAP_ENTRY_CACHE_TIMEOUT), @@ -1530,7 +1528,6 @@ int sdap_get_groups_recv(struct tevent_req *req, } static errno_t sdap_nested_group_populate_users(struct sysdb_ctx *sysdb, - struct sss_domain_info *dom, struct sdap_options *opts, struct sysdb_attrs **users, int num_users); @@ -1608,8 +1605,8 @@ static void sdap_nested_done(struct tevent_req *subreq) } in_transaction = true; - ret = sdap_nested_group_populate_users(state->sysdb, state->dom, - state->opts, users, user_count); + ret = sdap_nested_group_populate_users(state->sysdb, state->opts, + users, user_count); if (ret != EOK) { goto fail; } @@ -1642,7 +1639,6 @@ fail: } static errno_t sdap_nested_group_populate_users(struct sysdb_ctx *sysdb, - struct sss_domain_info *dom, struct sdap_options *opts, struct sysdb_attrs **users, int num_users) @@ -1970,7 +1966,6 @@ immediate: static errno_t sdap_nested_group_check_hash(struct sdap_nested_group_ctx *); static errno_t sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, - struct sss_domain_info *domain, struct sdap_options *opts, char *member_dn, struct ldb_message ***_msgs, @@ -2026,7 +2021,7 @@ static errno_t sdap_nested_group_process_deref_step(struct tevent_req *req) } ret = sdap_nested_group_check_cache(state, state->sysdb, - state->domain, state->opts, + state->opts, state->member_dn, &msgs, &mtype); if (ret == EOK) { @@ -2132,7 +2127,7 @@ static errno_t sdap_nested_group_process_step(struct tevent_req *req) } ret = sdap_nested_group_check_cache(state, state->sysdb, - state->domain, state->opts, + state->opts, state->member_dn, &msgs, &mtype); if (ret == EOK) { @@ -2225,7 +2220,6 @@ sdap_nested_group_check_hash(struct sdap_nested_group_ctx *state) static errno_t sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, - struct sss_domain_info *domain, struct sdap_options *opts, char *dn, struct ldb_message ***_msgs, diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c index 0ab30cfd..08eff0f0 100644 --- a/src/providers/ldap/sdap_async_initgroups.c +++ b/src/providers/ldap/sdap_async_initgroups.c @@ -29,7 +29,6 @@ /* ==Save-fake-group-list=====================================*/ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, struct sdap_options *opts, - struct sss_domain_info *dom, char **groupnames, struct sysdb_attrs **ldap_groups, int ldap_groups_count) @@ -162,7 +161,6 @@ fail: static int sdap_initgr_common_store(struct sysdb_ctx *sysdb, struct sdap_options *opts, - struct sss_domain_info *dom, const char *name, enum sysdb_member_type type, char **sysdb_grouplist, @@ -216,7 +214,7 @@ static int sdap_initgr_common_store(struct sysdb_ctx *sysdb, * member of but that are not cached in sysdb */ if (add_groups && add_groups[0]) { - ret = sdap_add_incomplete_groups(sysdb, opts, dom, + ret = sdap_add_incomplete_groups(sysdb, opts, add_groups, ldap_groups, ldap_groups_count); if (ret != EOK) { @@ -260,7 +258,6 @@ struct sdap_initgr_rfc2307_state { struct tevent_context *ev; struct sysdb_ctx *sysdb; struct sdap_options *opts; - struct sss_domain_info *dom; struct sdap_handle *sh; const char **attrs; const char *name; @@ -284,9 +281,7 @@ struct tevent_req *sdap_initgr_rfc2307_send(TALLOC_CTX *memctx, struct tevent_context *ev, struct sdap_options *opts, struct sysdb_ctx *sysdb, - struct sss_domain_info *dom, struct sdap_handle *sh, - const char *base_dn, const char *name) { struct tevent_req *req; @@ -300,7 +295,6 @@ struct tevent_req *sdap_initgr_rfc2307_send(TALLOC_CTX *memctx, state->ev = ev; state->opts = opts; state->sysdb = sysdb; - state->dom = dom; state->sh = sh; state->op = NULL; state->timeout = dp_opt_get_int(state->opts->basic, SDAP_SEARCH_TIMEOUT); @@ -485,7 +479,7 @@ static void sdap_initgr_rfc2307_process(struct tevent_req *subreq) /* There are no nested groups here so we can just update the * memberships */ ret = sdap_initgr_common_store(state->sysdb, state->opts, - state->dom, state->name, + state->name, SYSDB_MEMBER_USER, sysdb_grouplist, state->ldap_groups, @@ -508,7 +502,6 @@ static int sdap_initgr_rfc2307_recv(struct tevent_req *req) /* ==Common code for pure RFC2307bis and IPA/AD========================= */ static errno_t sdap_nested_groups_store(struct sysdb_ctx *sysdb, - struct sss_domain_info *dom, struct sdap_options *opts, struct sysdb_attrs **groups, unsigned long count) @@ -540,7 +533,7 @@ sdap_nested_groups_store(struct sysdb_ctx *sysdb, } in_transaction = true; - ret = sdap_add_incomplete_groups(sysdb, opts, dom, groupnamelist, + ret = sdap_add_incomplete_groups(sysdb, opts, groupnamelist, groups, count); if (ret != EOK) { DEBUG(6, ("Could not add incomplete groups [%d]: %s\n", @@ -874,7 +867,7 @@ fail: static errno_t sdap_initgr_store_groups(struct sdap_initgr_nested_state *state) { - return sdap_nested_groups_store(state->sysdb, state->dom, + return sdap_nested_groups_store(state->sysdb, state->opts, state->groups, state->groups_cur); } @@ -1606,7 +1599,7 @@ save_rfc2307bis_groups(struct sdap_initgr_rfc2307bis_state *state) } talloc_zfree(values); - ret = sdap_nested_groups_store(state->sysdb, state->dom, state->opts, + ret = sdap_nested_groups_store(state->sysdb, state->opts, groups, count); if (ret != EOK) { DEBUG(3, ("Could not save groups [%d]: %s\n", @@ -2430,10 +2423,8 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) } subreq = sdap_initgr_rfc2307_send(state, state->ev, state->opts, - state->sysdb, state->dom, state->sh, - dp_opt_get_string(state->opts->basic, - SDAP_GROUP_SEARCH_BASE), - state->name); + state->sysdb, state->sh, + state->name); if (!subreq) { tevent_req_error(req, ENOMEM); return; diff --git a/src/providers/ldap/sdap_async_netgroups.c b/src/providers/ldap/sdap_async_netgroups.c index 1f0d1dd2..e963159c 100644 --- a/src/providers/ldap/sdap_async_netgroups.c +++ b/src/providers/ldap/sdap_async_netgroups.c @@ -39,7 +39,6 @@ static bool is_dn(const char *str) static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, struct sysdb_ctx *ctx, struct sdap_options *opts, - struct sss_domain_info *dom, struct sysdb_attrs *attrs, char **_timestamp, time_t now) @@ -239,7 +238,6 @@ struct netgr_translate_members_state { struct tevent_context *ev; struct sdap_options *opts; struct sdap_handle *sh; - struct sss_domain_info *dom; struct sysdb_ctx *sysdb; struct sysdb_attrs **netgroups; @@ -284,7 +282,6 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, state->ev = ev; state->opts = opts; - state->dom = dom; state->sh = sh; state->sysdb = sysdb; state->netgroups = netgroups; @@ -729,7 +726,7 @@ static void netgr_translate_members_done(struct tevent_req *subreq) now = time(NULL); for (c = 0; c < state->count; c++) { ret = sdap_save_netgroup(state, state->sysdb, - state->opts, state->dom, + state->opts, state->netgroups[c], &state->higher_timestamp, now); -- cgit