summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2017-05-23 22:44:24 +0200
committerJakub Hrozek <jhrozek@redhat.com>2017-06-15 11:01:33 +0200
commit347be58e1769ba90b49a7e5ec1678ef66987f6cd (patch)
treed097326ddc6f3d159fad471e369ddaf7b22e7343 /src/db
parent01c6bb9b47401f9f14c4cfe5c5f03fce2e63629b (diff)
downloadsssd-347be58e1769ba90b49a7e5ec1678ef66987f6cd.tar.gz
sssd-347be58e1769ba90b49a7e5ec1678ef66987f6cd.tar.xz
sssd-347be58e1769ba90b49a7e5ec1678ef66987f6cd.zip
SYSDB: Internally expose sysdb_search_ts_matches()
This function will be used in the follow-up patches. As it's going to be "exposed", let's also rename it from search_ts_matches() to sysdb_search_ts_matches(). Related: https://pagure.io/SSSD/sssd/issue/3369 Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb_private.h7
-rw-r--r--src/db/sysdb_search.c20
2 files changed, 17 insertions, 10 deletions
diff --git a/src/db/sysdb_private.h b/src/db/sysdb_private.h
index dfddd2dda..433220dcc 100644
--- a/src/db/sysdb_private.h
+++ b/src/db/sysdb_private.h
@@ -260,6 +260,13 @@ int sysdb_search_ts_groups(TALLOC_CTX *mem_ctx,
const char **attrs,
struct ldb_result *res);
+errno_t sysdb_search_ts_matches(TALLOC_CTX *mem_ctx,
+ struct sysdb_ctx *sysdb,
+ const char *attrs[],
+ struct ldb_result *ts_res,
+ const char *filter,
+ struct ldb_result **_res);
+
/* Compares the modifyTimestamp attribute between old_entry and
* new_entry. Returns true if they differ (or either entry is missing
* the attribute) and false if the attribute is the same
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
index 6b4b51383..0c04b84a5 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -482,12 +482,12 @@ done:
return ret;
}
-static errno_t search_ts_matches(TALLOC_CTX *mem_ctx,
- struct sysdb_ctx *sysdb,
- const char *attrs[],
- struct ldb_result *ts_res,
- const char *filter,
- struct ldb_result **_res)
+errno_t sysdb_search_ts_matches(TALLOC_CTX *mem_ctx,
+ struct sysdb_ctx *sysdb,
+ const char *attrs[],
+ struct ldb_result *ts_res,
+ const char *filter,
+ struct ldb_result **_res)
{
char *dn_filter;
TALLOC_CTX *tmp_ctx = NULL;
@@ -595,8 +595,8 @@ int sysdb_enumpwent_filter(TALLOC_CTX *mem_ctx,
goto done;
}
- ret = search_ts_matches(tmp_ctx, domain->sysdb, attrs, &ts_res,
- name_filter, &ts_cache_res);
+ ret = sysdb_search_ts_matches(tmp_ctx, domain->sysdb, attrs, &ts_res,
+ name_filter, &ts_cache_res);
if (ret != EOK && ret != ENOENT) {
goto done;
}
@@ -1100,8 +1100,8 @@ int sysdb_enumgrent_filter(TALLOC_CTX *mem_ctx,
goto done;
}
- ret = search_ts_matches(tmp_ctx, domain->sysdb, attrs, &ts_res,
- name_filter, &ts_cache_res);
+ ret = sysdb_search_ts_matches(tmp_ctx, domain->sysdb, attrs, &ts_res,
+ name_filter, &ts_cache_res);
if (ret != EOK && ret != ENOENT) {
goto done;
}