From 796f3888e40d55ed888317c0be01026756866e16 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Thu, 7 May 2020 21:18:13 +0200 Subject: [PATCH 32/36] sysdb: make new_subdomain() public MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: https://github.com/SSSD/sssd/issues/5151 Reviewed-by: Pavel Březina (cherry picked with changes from commit 9aa26f6514220bae3b3314f830e3e3f95fab2cf9) Reviewed-by: Pavel Březina --- src/db/sysdb.h | 18 ++++++++++++++++++ src/db/sysdb_private.h | 19 ------------------- src/tests/cmocka/test_responder_cache_req.c | 1 - 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/db/sysdb.h b/src/db/sysdb.h index beee710af..018ec22ab 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -561,6 +561,24 @@ errno_t sysdb_subdomain_delete(struct sysdb_ctx *sysdb, const char *name); errno_t sysdb_subdomain_content_delete(struct sysdb_ctx *sysdb, const char *name); +/* The utility function to create a subdomain sss_domain_info object is handy + * for unit tests, so it should be available in a headerr. + */ +struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx, + struct sss_domain_info *parent, + const char *name, + const char *realm, + const char *flat_name, + const char *id, + enum sss_domain_mpg_mode mpg_mode, + bool enumerate, + const char *forest, + const char **upn_suffixes, + uint32_t trust_direction, + struct confdb_ctx *confdb, + bool enabled); + + errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, size_t *range_count, struct range_info ***range_list); diff --git a/src/db/sysdb_private.h b/src/db/sysdb_private.h index 7063d4594..0ccfa43ac 100644 --- a/src/db/sysdb_private.h +++ b/src/db/sysdb_private.h @@ -190,25 +190,6 @@ int sysdb_replace_ulong(struct ldb_message *msg, int sysdb_delete_ulong(struct ldb_message *msg, const char *attr, unsigned long value); -/* The utility function to create a subdomain sss_domain_info object is handy - * for unit tests, so it should be available in a header, but not a public util - * one, because the only interface for the daemon itself should be adding - * the sysdb domain object and calling sysdb_update_subdomains() - */ -struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx, - struct sss_domain_info *parent, - const char *name, - const char *realm, - const char *flat_name, - const char *id, - enum sss_domain_mpg_mode mpg_mode, - bool enumerate, - const char *forest, - const char **upn_suffixes, - uint32_t trust_direction, - struct confdb_ctx *confdb, - bool enabled); - /* Helper functions to deal with the timestamp cache should not be used * outside the sysdb itself. The timestamp cache should be completely * opaque to the sysdb consumers diff --git a/src/tests/cmocka/test_responder_cache_req.c b/src/tests/cmocka/test_responder_cache_req.c index 9f3b49cd9..4f3bc0b58 100644 --- a/src/tests/cmocka/test_responder_cache_req.c +++ b/src/tests/cmocka/test_responder_cache_req.c @@ -27,7 +27,6 @@ #include "tests/cmocka/common_mock_resp.h" #include "db/sysdb.h" #include "responder/common/cache_req/cache_req.h" -#include "db/sysdb_private.h" /* new_subdomain() */ #define TESTS_PATH "tp_" BASE_FILE_STEM #define TEST_CONF_DB "test_responder_cache_req_conf.ldb" -- 2.21.1