summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2017-05-24 00:35:23 +0200
committerJakub Hrozek <jhrozek@redhat.com>2017-06-15 11:01:29 +0200
commit01c6bb9b47401f9f14c4cfe5c5f03fce2e63629b (patch)
tree1dd69472161b0e3c0ddcfdc1902b165a5c07e936 /src/db
parent7e2ec7caa2d1c17e475fff78c5025496b8695509 (diff)
downloadsssd-01c6bb9b47401f9f14c4cfe5c5f03fce2e63629b.tar.gz
sssd-01c6bb9b47401f9f14c4cfe5c5f03fce2e63629b.tar.xz
sssd-01c6bb9b47401f9f14c4cfe5c5f03fce2e63629b.zip
SYSDB: Return ERR_NO_TS when there's no timestamp cache present
This change affects sysdb_search_ts_{users,groups} functions and is mainly needed in order to avoid breaking our current tests due to the changes planned for fixing https://pagure.io/SSSD/sssd/issue/3369. 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_ops.c4
-rw-r--r--src/db/sysdb_search.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 4d7b2abd8..12f8095d2 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -3520,7 +3520,7 @@ int sysdb_search_ts_users(TALLOC_CTX *mem_ctx,
ZERO_STRUCT(*res);
if (domain->sysdb->ldb_ts == NULL) {
- return ENOENT;
+ return ERR_NO_TS;
}
ret = sysdb_cache_search_users(mem_ctx, domain, domain->sysdb->ldb_ts,
@@ -3737,7 +3737,7 @@ int sysdb_search_ts_groups(TALLOC_CTX *mem_ctx,
ZERO_STRUCT(*res);
if (domain->sysdb->ldb_ts == NULL) {
- return ENOENT;
+ return ERR_NO_TS;
}
ret = sysdb_cache_search_groups(mem_ctx, domain, domain->sysdb->ldb_ts,
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c
index 474bc08f0..6b4b51383 100644
--- a/src/db/sysdb_search.c
+++ b/src/db/sysdb_search.c
@@ -587,6 +587,10 @@ int sysdb_enumpwent_filter(TALLOC_CTX *mem_ctx,
ret = sysdb_search_ts_users(tmp_ctx, domain, ts_filter,
sysdb_ts_cache_attrs,
&ts_res);
+ if (ret == ERR_NO_TS) {
+ ret = ENOENT;
+ }
+
if (ret != EOK && ret != ENOENT) {
goto done;
}
@@ -1088,6 +1092,10 @@ int sysdb_enumgrent_filter(TALLOC_CTX *mem_ctx,
ret = sysdb_search_ts_groups(tmp_ctx, domain, ts_filter,
sysdb_ts_cache_attrs,
&ts_res);
+ if (ret == ERR_NO_TS) {
+ ret = ENOENT;
+ }
+
if (ret != EOK && ret != ENOENT) {
goto done;
}