diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/db/sysdb.h | 1 | ||||
-rw-r--r-- | src/db/sysdb_ops.c | 13 | ||||
-rw-r--r-- | src/db/sysdb_services.c | 3 | ||||
-rw-r--r-- | src/db/sysdb_services.h | 1 | ||||
-rw-r--r-- | src/providers/ldap/sdap_async_services.c | 2 | ||||
-rw-r--r-- | src/providers/proxy/proxy_services.c | 9 | ||||
-rw-r--r-- | src/tests/sysdb-tests.c | 8 |
7 files changed, 21 insertions, 16 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h index 96bbb8d2..6fc71e1c 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -814,6 +814,7 @@ errno_t sysdb_set_enumerated(struct sysdb_ctx *sysdb, bool enumerated); errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, const char *name, enum sysdb_member_type type, char **remove_attrs); diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 06e930e1..5e6f6fb0 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -1582,7 +1582,7 @@ int sysdb_add_netgroup(struct sysdb_ctx *sysdb, ret = sysdb_set_netgroup_attr(sysdb, domain, name, attrs, SYSDB_MOD_REP); if (missing) { - ret = sysdb_remove_attrs(sysdb, name, + ret = sysdb_remove_attrs(sysdb, domain, name, SYSDB_MEMBER_NETGROUP, missing); if (ret != EOK) { @@ -1742,7 +1742,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb, if (ret != EOK) goto fail; if (remove_attrs) { - ret = sysdb_remove_attrs(sysdb, name, + ret = sysdb_remove_attrs(sysdb, domain, name, SYSDB_MEMBER_USER, remove_attrs); if (ret != EOK) { @@ -3070,6 +3070,7 @@ done: } errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, const char *name, enum sysdb_member_type type, char **remove_attrs) @@ -3086,19 +3087,19 @@ errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb, switch(type) { case SYSDB_MEMBER_USER: - msg->dn = sysdb_user_dn(sysdb, msg, sysdb->domain, name); + msg->dn = sysdb_user_dn(sysdb, msg, domain, name); break; case SYSDB_MEMBER_GROUP: - msg->dn = sysdb_group_dn(sysdb, msg, sysdb->domain, name); + msg->dn = sysdb_group_dn(sysdb, msg, domain, name); break; case SYSDB_MEMBER_NETGROUP: - msg->dn = sysdb_netgroup_dn(sysdb, msg, sysdb->domain, name); + msg->dn = sysdb_netgroup_dn(sysdb, msg, domain, name); break; case SYSDB_MEMBER_SERVICE: - msg->dn = sysdb_svc_dn(sysdb, msg, sysdb->domain->name, name); + msg->dn = sysdb_svc_dn(sysdb, msg, domain->name, name); break; } if (!msg->dn) { diff --git a/src/db/sysdb_services.c b/src/db/sysdb_services.c index 368cdeb6..2ac8d9a4 100644 --- a/src/db/sysdb_services.c +++ b/src/db/sysdb_services.c @@ -170,6 +170,7 @@ done: errno_t sysdb_store_service(struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, const char *primary_name, int port, const char **aliases, @@ -385,7 +386,7 @@ sysdb_store_service(struct sysdb_ctx *sysdb, if (ret != EOK) goto done; if (remove_attrs) { - ret = sysdb_remove_attrs(sysdb, primary_name, + ret = sysdb_remove_attrs(sysdb, domain, primary_name, SYSDB_MEMBER_SERVICE, remove_attrs); if (ret != EOK) { diff --git a/src/db/sysdb_services.h b/src/db/sysdb_services.h index 76ceb3cc..467a6584 100644 --- a/src/db/sysdb_services.h +++ b/src/db/sysdb_services.h @@ -66,6 +66,7 @@ sysdb_enumservent(TALLOC_CTX *mem_ctx, errno_t sysdb_store_service(struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, const char *primary_name, int port, const char **aliases, diff --git a/src/providers/ldap/sdap_async_services.c b/src/providers/ldap/sdap_async_services.c index 026fa13f..fd002b42 100644 --- a/src/providers/ldap/sdap_async_services.c +++ b/src/providers/ldap/sdap_async_services.c @@ -475,7 +475,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx, cache_timeout = dom->service_timeout; - ret = sysdb_store_service(sysdb, name, port, aliases, store_protocols, + ret = sysdb_store_service(sysdb, dom, name, port, aliases, store_protocols, svc_attrs, missing, cache_timeout, now); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, diff --git a/src/providers/proxy/proxy_services.c b/src/providers/proxy/proxy_services.c index 4f8a379b..3b79f81b 100644 --- a/src/providers/proxy/proxy_services.c +++ b/src/providers/proxy/proxy_services.c @@ -29,6 +29,7 @@ errno_t proxy_save_service(struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, struct servent *svc, bool lowercase, uint64_t cache_timeout) @@ -71,7 +72,7 @@ proxy_save_service(struct sysdb_ctx *sysdb, goto done; } - ret = sysdb_store_service(sysdb, + ret = sysdb_store_service(sysdb, domain, cased_name, ntohs(svc->s_port), cased_aliases, @@ -120,7 +121,7 @@ get_serv_byname(struct proxy_id_ctx *ctx, } else { /* Results found. Save them into the cache */ - ret = proxy_save_service(sysdb, result, + ret = proxy_save_service(sysdb, dom, result, !dom->case_sensitive, dom->service_timeout); } @@ -173,7 +174,7 @@ get_serv_byport(struct proxy_id_ctx *ctx, ret = sysdb_svc_delete(sysdb, NULL, port, protocol); } else { /* Results found. Save them into the cache */ - ret = proxy_save_service(sysdb, result, + ret = proxy_save_service(sysdb, dom, result, !dom->case_sensitive, dom->service_timeout); } @@ -302,7 +303,7 @@ enum_services(struct proxy_id_ctx *ctx, break; } - ret = sysdb_store_service(sysdb, + ret = sysdb_store_service(sysdb, dom, svc->s_name, svc->s_port, cased_aliases, diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c index 76d5e483..fa583e5e 100644 --- a/src/tests/sysdb-tests.c +++ b/src/tests/sysdb-tests.c @@ -4050,7 +4050,7 @@ START_TEST(test_sysdb_store_services) fail_if(ret != EOK); /* Store this group (which will add it) */ - ret = sysdb_store_service(test_ctx->sysdb, + ret = sysdb_store_service(test_ctx->sysdb, test_ctx->domain, primary_name, port, aliases, protocols, NULL, NULL, 1, 1); @@ -4067,7 +4067,7 @@ START_TEST(test_sysdb_store_services) aliases, protocols); /* Change the service name */ - ret = sysdb_store_service(test_ctx->sysdb, + ret = sysdb_store_service(test_ctx->sysdb, test_ctx->domain, alt_primary_name, port, aliases, protocols, NULL, NULL, 1, 1); @@ -4084,14 +4084,14 @@ START_TEST(test_sysdb_store_services) /* Change it back */ - ret = sysdb_store_service(test_ctx->sysdb, + ret = sysdb_store_service(test_ctx->sysdb, test_ctx->domain, primary_name, port, aliases, protocols, NULL, NULL, 1, 1); fail_if (ret != EOK, "[%s]", strerror(ret)); /* Change the port number */ - ret = sysdb_store_service(test_ctx->sysdb, + ret = sysdb_store_service(test_ctx->sysdb, test_ctx->domain, primary_name, altport, aliases, protocols, NULL, NULL, 1, 1); |