Ther are still some databases which are opened (locally) with
lock oder 0, which means don't do lock oder checking,
thereby circumventing this deadlock-prevention mechanism.
Add a symbolic constant for this "0" to make this circumvention
more explicit.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
struct db_record *rec;
struct dbwrap_lock_order_state *lock_order = NULL;
- if (db->lock_order != 0) {
+ if (db->lock_order != DBWRAP_LOCK_ORDER_NONE) {
lock_order = dbwrap_check_lock_order(db, mem_ctx);
if (lock_order == NULL) {
return NULL;
struct db_context;
enum dbwrap_lock_order {
+ DBWRAP_LOCK_ORDER_NONE = 0, /* Don't check lock orders for this db. */
DBWRAP_LOCK_ORDER_1 = 1,
DBWRAP_LOCK_ORDER_2 = 2,
DBWRAP_LOCK_ORDER_3 = 3