Blame SOURCES/0176-SYSDB-Internally-expose-sysdb_search_ts_matches.patch

bb7cd1
From 67e592572e655f19326cf821bbbe43411e8c7b06 Mon Sep 17 00:00:00 2001
bb7cd1
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
bb7cd1
Date: Tue, 23 May 2017 22:44:24 +0200
bb7cd1
Subject: [PATCH 176/181] SYSDB: Internally expose sysdb_search_ts_matches()
bb7cd1
MIME-Version: 1.0
bb7cd1
Content-Type: text/plain; charset=UTF-8
bb7cd1
Content-Transfer-Encoding: 8bit
bb7cd1
bb7cd1
This function will be used in the follow-up patches. As it's going to be
bb7cd1
"exposed", let's also rename it from search_ts_matches() to
bb7cd1
sysdb_search_ts_matches().
bb7cd1
bb7cd1
Related:
bb7cd1
https://pagure.io/SSSD/sssd/issue/3369
bb7cd1
bb7cd1
Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
bb7cd1
bb7cd1
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
bb7cd1
(cherry picked from commit 347be58e1769ba90b49a7e5ec1678ef66987f6cd)
bb7cd1
---
bb7cd1
 src/db/sysdb_private.h |  7 +++++++
bb7cd1
 src/db/sysdb_search.c  | 20 ++++++++++----------
bb7cd1
 2 files changed, 17 insertions(+), 10 deletions(-)
bb7cd1
bb7cd1
diff --git a/src/db/sysdb_private.h b/src/db/sysdb_private.h
bb7cd1
index dfddd2dda9e593bd02d52dee7d06f520a11bbdf6..433220dcc0c35366dbbee41525e6c5932eb897f9 100644
bb7cd1
--- a/src/db/sysdb_private.h
bb7cd1
+++ b/src/db/sysdb_private.h
bb7cd1
@@ -260,6 +260,13 @@ int sysdb_search_ts_groups(TALLOC_CTX *mem_ctx,
bb7cd1
                            const char **attrs,
bb7cd1
                            struct ldb_result *res);
bb7cd1
 
bb7cd1
+errno_t sysdb_search_ts_matches(TALLOC_CTX *mem_ctx,
bb7cd1
+                                struct sysdb_ctx *sysdb,
bb7cd1
+                                const char *attrs[],
bb7cd1
+                                struct ldb_result *ts_res,
bb7cd1
+                                const char *filter,
bb7cd1
+                                struct ldb_result **_res);
bb7cd1
+
bb7cd1
 /* Compares the modifyTimestamp attribute between old_entry and
bb7cd1
  * new_entry. Returns true if they differ (or either entry is missing
bb7cd1
  * the attribute) and false if the attribute is the same
bb7cd1
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
bb7cd1
index 6b4b51383d89788052ab7e4b572e86abba5330db..0c04b84a584e047a0ba8243c9216547ea2791e60 100644
bb7cd1
--- a/src/db/sysdb_search.c
bb7cd1
+++ b/src/db/sysdb_search.c
bb7cd1
@@ -482,12 +482,12 @@ done:
bb7cd1
     return ret;
bb7cd1
 }
bb7cd1
 
bb7cd1
-static errno_t search_ts_matches(TALLOC_CTX *mem_ctx,
bb7cd1
-                                 struct sysdb_ctx *sysdb,
bb7cd1
-                                 const char *attrs[],
bb7cd1
-                                 struct ldb_result *ts_res,
bb7cd1
-                                 const char *filter,
bb7cd1
-                                 struct ldb_result **_res)
bb7cd1
+errno_t sysdb_search_ts_matches(TALLOC_CTX *mem_ctx,
bb7cd1
+                                struct sysdb_ctx *sysdb,
bb7cd1
+                                const char *attrs[],
bb7cd1
+                                struct ldb_result *ts_res,
bb7cd1
+                                const char *filter,
bb7cd1
+                                struct ldb_result **_res)
bb7cd1
 {
bb7cd1
     char *dn_filter;
bb7cd1
     TALLOC_CTX *tmp_ctx = NULL;
bb7cd1
@@ -595,8 +595,8 @@ int sysdb_enumpwent_filter(TALLOC_CTX *mem_ctx,
bb7cd1
         goto done;
bb7cd1
     }
bb7cd1
 
bb7cd1
-    ret = search_ts_matches(tmp_ctx, domain->sysdb, attrs, &ts_res,
bb7cd1
-                            name_filter, &ts_cache_res);
bb7cd1
+    ret = sysdb_search_ts_matches(tmp_ctx, domain->sysdb, attrs, &ts_res,
bb7cd1
+                                  name_filter, &ts_cache_res);
bb7cd1
     if (ret != EOK && ret != ENOENT) {
bb7cd1
         goto done;
bb7cd1
     }
bb7cd1
@@ -1100,8 +1100,8 @@ int sysdb_enumgrent_filter(TALLOC_CTX *mem_ctx,
bb7cd1
         goto done;
bb7cd1
     }
bb7cd1
 
bb7cd1
-    ret = search_ts_matches(tmp_ctx, domain->sysdb, attrs, &ts_res,
bb7cd1
-                            name_filter, &ts_cache_res);
bb7cd1
+    ret = sysdb_search_ts_matches(tmp_ctx, domain->sysdb, attrs, &ts_res,
bb7cd1
+                                  name_filter, &ts_cache_res);
bb7cd1
     if (ret != EOK && ret != ENOENT) {
bb7cd1
         goto done;
bb7cd1
     }
bb7cd1
-- 
bb7cd1
2.9.4
bb7cd1