s4:ldb_msg - Use LDB constants on results
[ira/wip.git] / source4 / lib / ldb / common / ldb_msg.c
index 929f24cd88da4dbc7e3e4633789a1fe6c2855ba6..09173253d0341178168776243b0a74266449dc6e 100644 (file)
@@ -896,14 +896,16 @@ int ldb_msg_check_string_attribute(const struct ldb_message *msg, const char *na
        struct ldb_val val;
        
        el = ldb_msg_find_element(msg, name);
-       if (el == NULL)
-               return 0;
+       if (el == NULL) {
+               return LDB_SUCCESS;
+       }
 
        val.data = discard_const_p(uint8_t, value);
        val.length = strlen(value);
 
-       if (ldb_msg_find_val(el, &val))
-               return 1;
+       if (ldb_msg_find_val(el, &val)) {
+               return LDB_ERR_OPERATIONS_ERROR;
+       }
 
-       return 0;
+       return LDB_SUCCESS;
 }