diff options
Diffstat (limited to 'src/providers/ldap')
-rw-r--r-- | src/providers/ldap/ldap_auth.c | 3 | ||||
-rw-r--r-- | src/providers/ldap/ldap_common.c | 4 | ||||
-rw-r--r-- | src/providers/ldap/ldap_id.c | 13 | ||||
-rw-r--r-- | src/providers/ldap/ldap_id_cleanup.c | 11 | ||||
-rw-r--r-- | src/providers/ldap/ldap_id_enum.c | 4 | ||||
-rw-r--r-- | src/providers/ldap/ldap_id_netgroup.c | 2 | ||||
-rw-r--r-- | src/providers/ldap/sdap_access.c | 5 | ||||
-rw-r--r-- | src/providers/ldap/sdap_async_accounts.c | 49 | ||||
-rw-r--r-- | src/providers/ldap/sdap_async_netgroups.c | 2 |
9 files changed, 35 insertions, 58 deletions
diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c index 5857e537..efc9f527 100644 --- a/src/providers/ldap/ldap_auth.c +++ b/src/providers/ldap/ldap_auth.c @@ -376,7 +376,7 @@ static int get_user_dn(TALLOC_CTX *memctx, attrs[9] = SYSDB_PWD_ATTRIBUTE; attrs[10] = NULL; - ret = sysdb_get_user_attr(tmpctx, sysdb, dom, username, attrs, &res); + ret = sysdb_get_user_attr(tmpctx, sysdb, username, attrs, &res); if (ret) { goto done; } @@ -1100,7 +1100,6 @@ static void sdap_pam_auth_done(struct tevent_req *req) ret = sysdb_cache_password(state, state->breq->be_ctx->sysdb, - state->breq->be_ctx->domain, state->username, password); /* password caching failures are not fatal errors */ diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c index 78176ba8..f26a428d 100644 --- a/src/providers/ldap/ldap_common.c +++ b/src/providers/ldap/ldap_common.c @@ -492,9 +492,7 @@ int sdap_id_setup_tasks(struct sdap_id_ctx *ctx) * clients requesting get*ent information won't get an * immediate reply with no entries */ - ret = sysdb_has_enumerated(ctx->be->sysdb, - ctx->be->domain, - &has_enumerated); + ret = sysdb_has_enumerated(ctx->be->sysdb, &has_enumerated); if (ret != EOK) { return ret; } diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c index be347e17..9525224b 100644 --- a/src/providers/ldap/ldap_id.c +++ b/src/providers/ldap/ldap_id.c @@ -227,8 +227,7 @@ static void users_get_done(struct tevent_req *subreq) tevent_req_error(req, ret); return; case BE_FILTER_NAME: - ret = sysdb_delete_user(state, state->sysdb, - state->domain, state->name, 0); + ret = sysdb_delete_user(state, state->sysdb, state->name, 0); if (ret != EOK && ret != ENOENT) { tevent_req_error(req, ret); return; @@ -242,8 +241,7 @@ static void users_get_done(struct tevent_req *subreq) return; } - ret = sysdb_delete_user(state, state->sysdb, - state->domain, NULL, uid); + ret = sysdb_delete_user(state, state->sysdb, NULL, uid); if (ret != EOK && ret != ENOENT) { tevent_req_error(req, ret); return; @@ -472,8 +470,7 @@ static void groups_get_done(struct tevent_req *subreq) tevent_req_error(req, ret); return; case BE_FILTER_NAME: - ret = sysdb_delete_group(state, state->sysdb, - state->domain, state->name, 0); + ret = sysdb_delete_group(state, state->sysdb, state->name, 0); if (ret != EOK && ret != ENOENT) { tevent_req_error(req, ret); return; @@ -487,8 +484,7 @@ static void groups_get_done(struct tevent_req *subreq) return; } - ret = sysdb_delete_group(state, state->sysdb, - state->domain, NULL, gid); + ret = sysdb_delete_group(state, state->sysdb, NULL, gid); if (ret != EOK && ret != ENOENT) { tevent_req_error(req, ret); return; @@ -658,7 +654,6 @@ static void groups_by_user_done(struct tevent_req *subreq) if (ret == ENOENT) { ret = sysdb_delete_user(state, state->ctx->be->sysdb, - state->ctx->be->domain, state->name, 0); if (ret != EOK && ret != ENOENT) { tevent_req_error(req, ret); diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c index d31dace5..fc659271 100644 --- a/src/providers/ldap/ldap_id_cleanup.c +++ b/src/providers/ldap/ldap_id_cleanup.c @@ -245,7 +245,6 @@ static int cleanup_users(TALLOC_CTX *memctx, struct sdap_id_ctx *ctx) { TALLOC_CTX *tmpctx; struct sysdb_ctx *sysdb = ctx->be->sysdb; - struct sss_domain_info *domain = ctx->be->domain; const char *attrs[] = { SYSDB_NAME, SYSDB_UIDNUM, NULL }; time_t now = time(NULL); char *subfilter = NULL; @@ -291,7 +290,7 @@ static int cleanup_users(TALLOC_CTX *memctx, struct sdap_id_ctx *ctx) } ret = sysdb_search_users(tmpctx, sysdb, - domain, subfilter, attrs, &count, &msgs); + subfilter, attrs, &count, &msgs); if (ret) { if (ret == ENOENT) { ret = EOK; @@ -337,7 +336,7 @@ static int cleanup_users(TALLOC_CTX *memctx, struct sdap_id_ctx *ctx) /* If not logged in or cannot check the table, delete him */ DEBUG(9, ("About to delete user %s\n", name)); - ret = sysdb_delete_user(tmpctx, sysdb, domain, name, 0); + ret = sysdb_delete_user(tmpctx, sysdb, name, 0); if (ret) { goto done; } @@ -412,7 +411,7 @@ static int cleanup_groups(TALLOC_CTX *memctx, } ret = sysdb_search_groups(tmpctx, sysdb, - domain, subfilter, attrs, &count, &msgs); + subfilter, attrs, &count, &msgs); if (ret) { if (ret == ENOENT) { ret = EOK; @@ -453,7 +452,7 @@ static int cleanup_groups(TALLOC_CTX *memctx, } ret = sysdb_search_users(tmpctx, sysdb, - domain, subfilter, NULL, &u_count, &u_msgs); + subfilter, NULL, &u_count, &u_msgs); if (ret == ENOENT) { const char *name; @@ -466,7 +465,7 @@ static int cleanup_groups(TALLOC_CTX *memctx, } DEBUG(8, ("About to delete group %s\n", name)); - ret = sysdb_delete_group(tmpctx, sysdb, domain, name, 0); + ret = sysdb_delete_group(tmpctx, sysdb, name, 0); if (ret) { DEBUG(2, ("Group delete returned %d (%s)\n", ret, strerror(ret))); diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c index 40f3a2b6..eced42a8 100644 --- a/src/providers/ldap/ldap_id_enum.c +++ b/src/providers/ldap/ldap_id_enum.c @@ -147,9 +147,7 @@ static void ldap_id_enumerate_reschedule(struct tevent_req *req) * process on the next SSSD service restart (to avoid * slowing down system boot-up */ - ret = sysdb_set_enumerated(ctx->be->sysdb, - ctx->be->domain, - true); + ret = sysdb_set_enumerated(ctx->be->sysdb, true); if (ret != EOK) { DEBUG(1, ("Could not mark domain as having enumerated.\n")); /* This error is non-fatal, so continue */ diff --git a/src/providers/ldap/ldap_id_netgroup.c b/src/providers/ldap/ldap_id_netgroup.c index 7b9ad0f1..6e21956d 100644 --- a/src/providers/ldap/ldap_id_netgroup.c +++ b/src/providers/ldap/ldap_id_netgroup.c @@ -203,7 +203,7 @@ static void netgroup_get_done(struct tevent_req *subreq) } if (ret == ENOENT) { - ret = sysdb_delete_netgroup(state->sysdb, state->domain, state->name); + ret = sysdb_delete_netgroup(state->sysdb, state->name); if (ret != EOK && ret != ENOENT) { tevent_req_error(req, ret); return; diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c index 9bb2f2ef..0ac0f639 100644 --- a/src/providers/ldap/sdap_access.c +++ b/src/providers/ldap/sdap_access.c @@ -172,9 +172,7 @@ static struct tevent_req *sdap_access_send(TALLOC_CTX *mem_ctx, } /* Get original user DN */ - ret = sysdb_get_user_attr(state, be_ctx->sysdb, be_ctx->domain, - pd->user, attrs, - &res); + ret = sysdb_get_user_attr(state, be_ctx->sysdb, pd->user, attrs, &res); if (ret != EOK) { if (ret == ENOENT) { /* If we can't find the user, return permission denied */ @@ -1062,7 +1060,6 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) ret = sysdb_set_user_attr(attrs, state->be_ctx->sysdb, - state->be_ctx->domain, state->username, attrs, SYSDB_MOD_REP); if (ret != EOK) { diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c index bea965b4..a6907a34 100644 --- a/src/providers/ldap/sdap_async_accounts.c +++ b/src/providers/ldap/sdap_async_accounts.c @@ -298,7 +298,7 @@ static int sdap_save_user(TALLOC_CTX *memctx, DEBUG(6, ("Storing info for user %s\n", name)); - ret = sysdb_store_user(user_attrs, ctx, dom, + ret = sysdb_store_user(user_attrs, ctx, name, pwd, uid, gid, gecos, homedir, shell, user_attrs, missing, cache_timeout); if (ret) goto fail; @@ -666,7 +666,6 @@ done: static errno_t sdap_store_group_with_gid(TALLOC_CTX *mem_ctx, struct sysdb_ctx *ctx, - struct sss_domain_info *domain, const char *name, gid_t gid, struct sysdb_attrs *group_attrs, @@ -685,7 +684,7 @@ sdap_store_group_with_gid(TALLOC_CTX *mem_ctx, } } - ret = sysdb_store_group(mem_ctx, ctx, domain, + ret = sysdb_store_group(mem_ctx, ctx, name, gid, group_attrs, cache_timeout); if (ret) { @@ -857,7 +856,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(group_attrs, ctx, name, gid, group_attrs, dp_opt_get_int(opts->basic, SDAP_ENTRY_CACHE_TIMEOUT), @@ -929,8 +928,7 @@ static int sdap_save_grpmem(TALLOC_CTX *memctx, DEBUG(6, ("Storing members for group %s\n", name)); - ret = sysdb_store_group(memctx, ctx, dom, - name, 0, group_attrs, + ret = sysdb_store_group(memctx, ctx, name, 0, group_attrs, dp_opt_get_int(opts->basic, SDAP_ENTRY_CACHE_TIMEOUT)); if (ret) goto fail; @@ -1315,8 +1313,7 @@ sdap_process_group_members_2307(struct sdap_process_group_state *state, /* We need to skip over zero-length usernames */ if (member_name[0] == '\0') continue; - ret = sysdb_search_user_by_name(state, state->sysdb, - state->dom, member_name, + ret = sysdb_search_user_by_name(state, state->sysdb, member_name, NULL, &msg); if (ret == EOK) { strdn = sysdb_user_strdn(state->sysdb_dns->values, @@ -1457,7 +1454,7 @@ sdap_process_missing_member_2307(struct sdap_process_group_state *state, *in_transaction = true; } - ret = sysdb_add_fake_user(state->sysdb, state->dom, username, NULL); + ret = sysdb_add_fake_user(state->sysdb, username, NULL); if (ret != EOK) { DEBUG(1, ("Cannot store fake user entry: [%d]: %s\n", ret, strerror(ret))); @@ -2025,7 +2022,7 @@ static errno_t sdap_nested_group_populate_users(struct sysdb_ctx *sysdb, ret = ENOMEM; goto done; } - ret = sysdb_search_users(tmp_ctx, sysdb, dom, filter, + ret = sysdb_search_users(tmp_ctx, sysdb, filter, search_attrs, &count, &msgs); talloc_zfree(filter); talloc_zfree(clean_orig_dn); @@ -2056,12 +2053,12 @@ static errno_t sdap_nested_group_populate_users(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, username); if (ret) goto done; ret = sysdb_set_user_attr(tmp_ctx, sysdb, - dom, sysdb_name, attrs, SYSDB_MOD_REP); + sysdb_name, attrs, SYSDB_MOD_REP); if (ret != EOK) goto done; } /* If the entry does not exist add a fake user record */ - ret = sysdb_add_fake_user(sysdb, dom, username, original_dn); + ret = sysdb_add_fake_user(sysdb, username, original_dn); if (ret != EOK) { DEBUG(1, ("Cannot store fake user entry, ignoring: [%d]: %s\n", ret, strerror(ret))); @@ -2130,7 +2127,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, in_transaction = true; for (i=0; groupnames[i]; i++) { - ret = sysdb_search_group_by_name(tmp_ctx, sysdb, dom, + ret = sysdb_search_group_by_name(tmp_ctx, sysdb, groupnames[i], NULL, &msg); if (ret == EOK) { continue; @@ -2190,7 +2187,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, } DEBUG(8, ("Adding fake group %s to sysdb\n", name)); - ret = sysdb_add_incomplete_group(sysdb, dom, name, + ret = sysdb_add_incomplete_group(sysdb, name, gid, original_dn, posix); if (ret != EOK) { goto fail; @@ -2280,8 +2277,7 @@ static int sdap_initgr_common_store(struct sysdb_ctx *sysdb, } DEBUG(8, ("Updating memberships for %s\n", name)); - ret = sysdb_update_members(sysdb, dom, name, - type, + ret = sysdb_update_members(sysdb, name, type, (const char *const *) add_groups, (const char *const *) del_groups); if (ret != EOK) { @@ -2412,7 +2408,7 @@ static void sdap_initgr_rfc2307_process(struct tevent_req *subreq) /* Search for all groups for which this user is a member */ attrs[0] = SYSDB_MEMBEROF; attrs[1] = NULL; - ret = sysdb_search_user_by_name(state, state->sysdb, state->dom, + ret = sysdb_search_user_by_name(state, state->sysdb, state->name, attrs, &msg); if (ret != EOK) { tevent_req_error(req, ret); @@ -3833,8 +3829,7 @@ sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx, } /* Try users first */ - ret = sysdb_search_users(tmp_ctx, sysdb, domain, filter, - attrs, &count, &msgs); + ret = sysdb_search_users(tmp_ctx, sysdb, filter, attrs, &count, &msgs); if (ret != EOK && ret != ENOENT) { ret = EIO; goto fail; @@ -3880,8 +3875,7 @@ sdap_nested_group_check_cache(TALLOC_CTX *mem_ctx, /* It wasn't a user. Check whether it's a group */ if (ret == EOK) talloc_zfree(msgs); - ret = sysdb_search_groups(tmp_ctx, sysdb, domain, - filter, attrs, &count, &msgs); + ret = sysdb_search_groups(tmp_ctx, sysdb, filter, attrs, &count, &msgs); if (ret != EOK && ret != ENOENT) { ret = EIO; goto fail; @@ -4737,8 +4731,8 @@ errno_t save_rfc2307bis_user_memberships( } talloc_free(sanitized_dn); - ret = sysdb_search_groups(tmp_ctx, state->sysdb, state->dom, - filter, attrs, &reply_count, &replies); + ret = sysdb_search_groups(tmp_ctx, state->sysdb, filter, attrs, + &reply_count, &replies); if (ret != EOK && ret != ENOENT) { goto error; } if (ret == ENOENT) { @@ -4802,8 +4796,7 @@ errno_t save_rfc2307bis_user_memberships( } DEBUG(8, ("Updating memberships for %s\n", state->name)); - ret = sysdb_update_members(state->sysdb, state->dom, state->name, - SYSDB_MEMBER_USER, + ret = sysdb_update_members(state->sysdb, state->name, SYSDB_MEMBER_USER, (const char *const *)add_groups, (const char *const *)del_groups); if (ret != EOK) { @@ -5229,8 +5222,7 @@ static errno_t rfc2307bis_nested_groups_update_sysdb( } talloc_free(sanitized_dn); - ret = sysdb_search_groups(tmp_ctx, state->sysdb, state->dom, - filter, attrs, + ret = sysdb_search_groups(tmp_ctx, state->sysdb, filter, attrs, &reply_count, &replies); if (ret != EOK && ret != ENOENT) { goto error; @@ -5296,8 +5288,7 @@ static errno_t rfc2307bis_nested_groups_update_sysdb( talloc_free(sysdb_grouplist); DEBUG(8, ("Updating memberships for %s\n", name)); - ret = sysdb_update_members(state->sysdb, state->dom, name, - SYSDB_MEMBER_GROUP, + ret = sysdb_update_members(state->sysdb, name, SYSDB_MEMBER_GROUP, (const char *const *)add_groups, (const char *const *)del_groups); if (ret != EOK) { diff --git a/src/providers/ldap/sdap_async_netgroups.c b/src/providers/ldap/sdap_async_netgroups.c index 1f6c6d06..ff776289 100644 --- a/src/providers/ldap/sdap_async_netgroups.c +++ b/src/providers/ldap/sdap_async_netgroups.c @@ -165,7 +165,7 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, DEBUG(6, ("Storing info for netgroup %s\n", name)); - ret = sysdb_add_netgroup(ctx, dom, name, NULL, netgroup_attrs, + ret = sysdb_add_netgroup(ctx, name, NULL, netgroup_attrs, dp_opt_get_int(opts->basic, SDAP_ENTRY_CACHE_TIMEOUT)); if (ret) goto fail; |