summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Kroeger <andrew@sprocks.gotdns.com>2008-01-18 01:48:48 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-18 03:41:59 +0100
commit158a2eed334512c28a7101b3af2c364b4ac1b3fd (patch)
treeb87db6377580708b840bb4b585d161ea1bf4d93d /source4
parent73626c266c3ea1b477185a428b2c1be64feff598 (diff)
downloadsamba-158a2eed334512c28a7101b3af2c364b4ac1b3fd.tar.gz
samba-158a2eed334512c28a7101b3af2c364b4ac1b3fd.tar.bz2
samba-158a2eed334512c28a7101b3af2c364b4ac1b3fd.zip
registry: Properly check return values from ldb_*() functions.
There were a few cases left that attempted to detect errors from ldb_*() function calls using "(ret < 0)". As all LDB_* error codes are greater than zero, there was no chance any errors would be detected. Changed all such tests to use "(ret != LDB_SUCCESS)". (This used to be commit 0ed6f1b1628da5b922f02a5f9a6c60071b6277f2)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/ldb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index d56b63299d..d87bc6cf8e 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -400,7 +400,7 @@ static WERROR ldb_add_key(TALLOC_CTX *mem_ctx, const struct hive_key *parent,
talloc_strdup(mem_ctx, classname));
ret = ldb_add(parentkd->ldb, msg);
- if (ret < 0) {
+ if (ret != LDB_SUCCESS) {
DEBUG(1, ("ldb_msg_add: %s\n", ldb_errstring(parentkd->ldb)));
return WERR_FOOBAR;
}
@@ -432,7 +432,7 @@ static WERROR ldb_del_key(const struct hive_key *key, const char *child)
if (ret == LDB_ERR_NO_SUCH_OBJECT) {
return WERR_NOT_FOUND;
- } else if (ret < 0) {
+ } else if (ret != LDB_SUCCESS) {
DEBUG(1, ("ldb_del_key: %s\n", ldb_errstring(parentkd->ldb)));
return WERR_FOOBAR;
}
@@ -455,7 +455,7 @@ static WERROR ldb_del_value (struct hive_key *key, const char *child)
if (ret == LDB_ERR_NO_SUCH_OBJECT) {
return WERR_NOT_FOUND;
- } else if (ret < 0) {
+ } else if (ret != LDB_SUCCESS) {
DEBUG(1, ("ldb_del_value: %s\n", ldb_errstring(kd->ldb)));
return WERR_FOOBAR;
}