2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[1891] reject attempt of deleting NSEC3 before start transaction.

This commit is contained in:
JINMEI Tatuya
2012-04-17 17:52:18 -07:00
parent 9a4619a0a1
commit 47f1415387
2 changed files with 8 additions and 2 deletions

View File

@@ -1197,8 +1197,10 @@ void
SQLite3Accessor::deleteNSEC3RecordInZone(
const string (&params)[DEL_PARAM_COUNT])
{
// TBD: no transaction check
if (!dbparameters_->updating_zone) {
isc_throw(DataSourceError, "deleting NSEC3-related record in SQLite3 "
"data source without transaction");
}
doUpdate<const string (&)[DEL_PARAM_COUNT]>(
*dbparameters_, DEL_NSEC3_RECORD, params,
"delete NSEC3 record from zone");

View File

@@ -1180,6 +1180,10 @@ TEST_F(SQLite3Update, deleteNonexistent) {
TEST_F(SQLite3Update, invalidDelete) {
// An attempt of delete before an explicit start of transaction
EXPECT_THROW(accessor->deleteRecordInZone(del_params), DataSourceError);
// Same for NSEC3.
EXPECT_THROW(accessor->deleteNSEC3RecordInZone(del_params),
DataSourceError);
}
TEST_F(SQLite3Update, emptyTransaction) {