dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0015-sysdb-make-new_subdomain-public.patch

1bb595
From 9aa26f6514220bae3b3314f830e3e3f95fab2cf9 Mon Sep 17 00:00:00 2001
1bb595
From: Sumit Bose <sbose@redhat.com>
1bb595
Date: Thu, 7 May 2020 21:18:13 +0200
1bb595
Subject: [PATCH 15/19] sysdb: make new_subdomain() public
1bb595
MIME-Version: 1.0
1bb595
Content-Type: text/plain; charset=UTF-8
1bb595
Content-Transfer-Encoding: 8bit
1bb595
1bb595
Resolves: https://github.com/SSSD/sssd/issues/5151
1bb595
1bb595
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
1bb595
---
1bb595
 src/db/sysdb.h                              | 18 ++++++++++++++++++
1bb595
 src/db/sysdb_private.h                      | 19 -------------------
1bb595
 src/tests/cmocka/test_negcache.c            |  1 -
1bb595
 src/tests/cmocka/test_nss_srv.c             |  1 -
1bb595
 src/tests/cmocka/test_responder_cache_req.c |  1 -
1bb595
 5 files changed, 18 insertions(+), 22 deletions(-)
1bb595
1bb595
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
1bb595
index 64e546f5b..e4ed10b54 100644
1bb595
--- a/src/db/sysdb.h
1bb595
+++ b/src/db/sysdb.h
1bb595
@@ -562,6 +562,24 @@ errno_t sysdb_subdomain_delete(struct sysdb_ctx *sysdb, const char *name);
1bb595
 errno_t sysdb_subdomain_content_delete(struct sysdb_ctx *sysdb,
1bb595
                                        const char *name);
1bb595
 
1bb595
+/* The utility function to create a subdomain sss_domain_info object is handy
1bb595
+ * for unit tests, so it should be available in a headerr.
1bb595
+ */
1bb595
+struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
1bb595
+                                      struct sss_domain_info *parent,
1bb595
+                                      const char *name,
1bb595
+                                      const char *realm,
1bb595
+                                      const char *flat_name,
1bb595
+                                      const char *id,
1bb595
+                                      enum sss_domain_mpg_mode mpg_mode,
1bb595
+                                      bool enumerate,
1bb595
+                                      const char *forest,
1bb595
+                                      const char **upn_suffixes,
1bb595
+                                      uint32_t trust_direction,
1bb595
+                                      struct confdb_ctx *confdb,
1bb595
+                                      bool enabled);
1bb595
+
1bb595
+
1bb595
 errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
1bb595
                              size_t *range_count,
1bb595
                              struct range_info ***range_list);
1bb595
diff --git a/src/db/sysdb_private.h b/src/db/sysdb_private.h
1bb595
index 3302919a6..70fe3fa18 100644
1bb595
--- a/src/db/sysdb_private.h
1bb595
+++ b/src/db/sysdb_private.h
1bb595
@@ -196,25 +196,6 @@ int sysdb_replace_ulong(struct ldb_message *msg,
1bb595
 int sysdb_delete_ulong(struct ldb_message *msg,
1bb595
                        const char *attr, unsigned long value);
1bb595
 
1bb595
-/* The utility function to create a subdomain sss_domain_info object is handy
1bb595
- * for unit tests, so it should be available in a header, but not a public util
1bb595
- * one, because the only interface for the daemon itself should be adding
1bb595
- * the sysdb domain object and calling sysdb_update_subdomains()
1bb595
- */
1bb595
-struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
1bb595
-                                      struct sss_domain_info *parent,
1bb595
-                                      const char *name,
1bb595
-                                      const char *realm,
1bb595
-                                      const char *flat_name,
1bb595
-                                      const char *id,
1bb595
-                                      enum sss_domain_mpg_mode mpg_mode,
1bb595
-                                      bool enumerate,
1bb595
-                                      const char *forest,
1bb595
-                                      const char **upn_suffixes,
1bb595
-                                      uint32_t trust_direction,
1bb595
-                                      struct confdb_ctx *confdb,
1bb595
-                                      bool enabled);
1bb595
-
1bb595
 /* Helper functions to deal with the timestamp cache should not be used
1bb595
  * outside the sysdb itself. The timestamp cache should be completely
1bb595
  * opaque to the sysdb consumers
1bb595
diff --git a/src/tests/cmocka/test_negcache.c b/src/tests/cmocka/test_negcache.c
1bb595
index 3ed1cb14a..b3a379227 100644
1bb595
--- a/src/tests/cmocka/test_negcache.c
1bb595
+++ b/src/tests/cmocka/test_negcache.c
1bb595
@@ -38,7 +38,6 @@
1bb595
 #include "util/util_sss_idmap.h"
1bb595
 #include "lib/idmap/sss_idmap.h"
1bb595
 #include "util/util.h"
1bb595
-#include "db/sysdb_private.h"
1bb595
 #include "responder/common/responder.h"
1bb595
 #include "responder/common/negcache.h"
1bb595
 
1bb595
diff --git a/src/tests/cmocka/test_nss_srv.c b/src/tests/cmocka/test_nss_srv.c
1bb595
index 3cd7809cf..99ba02a80 100644
1bb595
--- a/src/tests/cmocka/test_nss_srv.c
1bb595
+++ b/src/tests/cmocka/test_nss_srv.c
1bb595
@@ -36,7 +36,6 @@
1bb595
 #include "util/crypto/sss_crypto.h"
1bb595
 #include "util/crypto/nss/nss_util.h"
1bb595
 #include "util/sss_endian.h"
1bb595
-#include "db/sysdb_private.h"   /* new_subdomain() */
1bb595
 #include "db/sysdb_iphosts.h"
1bb595
 #include "db/sysdb_ipnetworks.h"
1bb595
 
1bb595
diff --git a/src/tests/cmocka/test_responder_cache_req.c b/src/tests/cmocka/test_responder_cache_req.c
1bb595
index 2611c589b..68a651240 100644
1bb595
--- a/src/tests/cmocka/test_responder_cache_req.c
1bb595
+++ b/src/tests/cmocka/test_responder_cache_req.c
1bb595
@@ -27,7 +27,6 @@
1bb595
 #include "tests/cmocka/common_mock_resp.h"
1bb595
 #include "db/sysdb.h"
1bb595
 #include "responder/common/cache_req/cache_req.h"
1bb595
-#include "db/sysdb_private.h"   /* new_subdomain() */
1bb595
 
1bb595
 #define TESTS_PATH "tp_" BASE_FILE_STEM
1bb595
 #define TEST_CONF_DB "test_responder_cache_req_conf.ldb"
1bb595
-- 
1bb595
2.21.3
1bb595