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

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