summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-07-19 18:32:40 -0400
committerJakub Hrozek <jhrozek@redhat.com>2012-08-01 22:24:44 +0200
commitcb388d52f49f54963379cc20a25e14d17fe6e9a3 (patch)
treea6469b84a3fd4855bc9c51e2a37c08880e5340f5 /src
parent7616a65d63d3bd0f669a871fd0ed89185956e9ce (diff)
downloadsssd-cb388d52f49f54963379cc20a25e14d17fe6e9a3.tar.gz
sssd-cb388d52f49f54963379cc20a25e14d17fe6e9a3.tar.bz2
sssd-cb388d52f49f54963379cc20a25e14d17fe6e9a3.zip
Fix return error and debug message
The debuf message was trying to print the number of returned entries, but no integer was provided. Return ENOENT as the error for when there are no entries, not EINVAL.
Diffstat (limited to 'src')
-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 f5c16ac7..533874f6 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;
}