s4-dsdb: return LDB_ERR_CONSTRAINT_VIOLATION on num_recs != 1
authorAndrew Tridgell <tridge@samba.org>
Tue, 16 Feb 2010 05:39:49 +0000 (16:39 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 16 Feb 2010 10:10:52 +0000 (21:10 +1100)
In a single record search, LDB_ERR_CONSTRAINT_VIOLATION is more useful
than the generic LDB_ERR_OPERATIONS_ERROR

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/dsdb/common/util.c

index 2031aa9def063577d9808661f5187bb7c0fb6a46..6cdede1f223aa170cc44d1e606657752c58474f4 100644 (file)
@@ -3443,7 +3443,7 @@ int dsdb_search(struct ldb_context *ldb,
                }
                if (res->count != 1) {
                        talloc_free(tmp_ctx);
-                       return LDB_ERR_OPERATIONS_ERROR;
+                       return LDB_ERR_CONSTRAINT_VIOLATION;
                }
        }