From: Gary Lockyer Date: Wed, 14 Mar 2018 22:37:06 +0000 (+1300) Subject: ldb_tdb: ltdb_tdb_delete require active transaction X-Git-Tag: ldb-1.4.0~701 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1fceb64dc2c7f994e800b00cc9fbd214ac42a201;p=thirdparty%2Fsamba.git ldb_tdb: ltdb_tdb_delete require active transaction Signed-off-by: Gary Lockyer Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c index 5476e665e9c..1d06566aa30 100644 --- a/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/lib/ldb/ldb_tdb/ldb_tdb.c @@ -674,6 +674,10 @@ static int ltdb_tdb_delete(struct ltdb_private *ltdb, struct ldb_val ldb_key) .dptr = ldb_key.data, .dsize = ldb_key.length }; + bool transaction_active = tdb_transaction_active(ltdb->tdb); + if (transaction_active == false){ + return LDB_ERR_PROTOCOL_ERROR; + } return tdb_delete(ltdb->tdb, tdb_key); }