summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/db/sysdb_subdomains.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index f5c16ac70..533874f66 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -154,9 +154,14 @@ errno_t sysdb_master_domain_get_info(TALLOC_CTX *mem_ctx,
goto done;
}
- if (res->count != 1) {
+ if (res->count == 0) {
+ ret = ENOENT;
+ goto done;
+ }
+
+ if (res->count > 1) {
DEBUG(SSSDBG_OP_FAILURE, ("Base search returned [%d] results, "
- "expected 1.\n"));
+ "expected 1.\n", res->count));
ret = EINVAL;
goto done;
}