DSDB cosmetic patches: Some enhancements
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Thu, 25 Sep 2008 10:21:28 +0000 (12:21 +0200)
committerSimo Sorce <idra@samba.org>
Mon, 13 Oct 2008 14:47:06 +0000 (10:47 -0400)
Also, use the constants more in the "ldif_handlers" module.

source4/dsdb/samdb/ldb_modules/proxy.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 932fd3bcb6b284dbb2711de37225b89b32320d1c..2ff42297b7491af70db902c23118a53794d715fe 100644 (file)
@@ -317,7 +317,7 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
                goto passthru;
        }
 
-       if (load_proxy_info(module) != 0) {
+       if (load_proxy_info(module) != LDB_SUCCESS) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
index d10c95eacb382302203840910db927a6705cc45f..f30748c85c5055ee607fbf3f46907f1c4e031170 100644 (file)
@@ -98,7 +98,7 @@ static int add_time_element(struct ldb_message *msg, const char *attr, time_t t)
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       if (ldb_msg_add_string(msg, attr, s) != 0) {
+       if (ldb_msg_add_string(msg, attr, s) != LDB_SUCCESS) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
@@ -121,7 +121,7 @@ static int add_uint64_element(struct ldb_message *msg, const char *attr, uint64_
                return LDB_SUCCESS;
        }
 
-       if (ldb_msg_add_fmt(msg, attr, "%llu", (unsigned long long)v) != 0) {
+       if (ldb_msg_add_fmt(msg, attr, "%llu", (unsigned long long)v) != LDB_SUCCESS) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
@@ -270,7 +270,7 @@ static int replmd_add(struct ldb_module *module, struct ldb_request *req)
 
        ac->schema = schema;
 
-       if (ldb_msg_find_element(req->op.add.message, "objectGUID")) {
+       if (ldb_msg_find_element(req->op.add.message, "objectGUID") != NULL) {
                ldb_debug_set(module->ldb, LDB_DEBUG_ERROR,
                              "replmd_add: it's not allowed to add an object with objectGUID\n");
                return LDB_ERR_UNWILLING_TO_PERFORM;
@@ -495,7 +495,7 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
         * - calculate the new replPropertyMetaData attribute
         */
 
-       if (add_time_element(msg, "whenChanged", t) != 0) {
+       if (add_time_element(msg, "whenChanged", t) != LDB_SUCCESS) {
                talloc_free(ac);
                return LDB_ERR_OPERATIONS_ERROR;
        }
@@ -503,7 +503,7 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
        /* Get a sequence number from the backend */
        ret = ldb_sequence_number(module->ldb, LDB_SEQ_NEXT, &seq_num);
        if (ret == LDB_SUCCESS) {
-               if (add_uint64_element(msg, "uSNChanged", seq_num) != 0) {
+               if (add_uint64_element(msg, "uSNChanged", seq_num) != LDB_SUCCESS) {
                        talloc_free(ac);
                        return LDB_ERR_OPERATIONS_ERROR;
                }