s4:operational LDB module - Fix usage of LDB constants
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Thu, 3 Dec 2009 11:50:18 +0000 (12:50 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Thu, 3 Dec 2009 11:51:16 +0000 (12:51 +0100)
source4/dsdb/samdb/ldb_modules/operational.c

index e48f91bac0b12ba2d89fa2e8d47f6a9e0576a051..031544d6a81d465b9cef34803643b5572a14d5a1 100644 (file)
@@ -88,7 +88,7 @@ static int construct_canonical_name(struct ldb_module *module,
        char *canonicalName;
        canonicalName = ldb_dn_canonical_string(msg, msg->dn);
        if (canonicalName == NULL) {
-               return -1;
+               return LDB_ERR_OPERATIONS_ERROR;
        }
        return ldb_msg_add_steal_string(msg, "canonicalName", canonicalName);
 }
@@ -255,13 +255,13 @@ static int operational_search_post_process(struct ldb_module *module,
 
                        /* construct the new attribute, using either a supplied
                           constructor or a simple copy */
-                       if (search_sub[i].constructor) {
-                               if (search_sub[i].constructor(module, msg) != 0) {
+                       if (search_sub[i].constructor != NULL) {
+                               if (search_sub[i].constructor(module, msg) != LDB_SUCCESS) {
                                        goto failed;
                                }
                        } else if (ldb_msg_copy_attr(msg,
                                                     search_sub[i].replace,
-                                                    search_sub[i].attr) != 0) {
+                                                    search_sub[i].attr) != LDB_SUCCESS) {
                                goto failed;
                        }