summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ldapd/btree.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/ldapd/btree.c b/usr.sbin/ldapd/btree.c
index 4cdd1a70d96..b9d68b7a834 100644
--- a/usr.sbin/ldapd/btree.c
+++ b/usr.sbin/ldapd/btree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: btree.c,v 1.10 2010/06/13 06:55:33 martinh Exp $ */
+/* $OpenBSD: btree.c,v 1.11 2010/06/15 15:54:39 martinh Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -2433,6 +2433,11 @@ btree_txn_del(struct btree *bt, struct btree_txn *txn,
return BT_FAIL;
}
+ if (txn != NULL && F_ISSET(txn->flags, BT_TXN_RDONLY)) {
+ errno = EINVAL;
+ return BT_FAIL;
+ }
+
if (bt == NULL) {
if (txn == NULL) {
errno = EINVAL;
@@ -2743,6 +2748,11 @@ btree_txn_put(struct btree *bt, struct btree_txn *txn,
return BT_FAIL;
}
+ if (txn != NULL && F_ISSET(txn->flags, BT_TXN_RDONLY)) {
+ errno = EINVAL;
+ return BT_FAIL;
+ }
+
if (bt == NULL) {
if (txn == NULL) {
errno = EINVAL;