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:
@@ -1197,8 +1197,10 @@ void
|
|||||||
SQLite3Accessor::deleteNSEC3RecordInZone(
|
SQLite3Accessor::deleteNSEC3RecordInZone(
|
||||||
const string (¶ms)[DEL_PARAM_COUNT])
|
const string (¶ms)[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]>(
|
doUpdate<const string (&)[DEL_PARAM_COUNT]>(
|
||||||
*dbparameters_, DEL_NSEC3_RECORD, params,
|
*dbparameters_, DEL_NSEC3_RECORD, params,
|
||||||
"delete NSEC3 record from zone");
|
"delete NSEC3 record from zone");
|
||||||
|
@@ -1180,6 +1180,10 @@ TEST_F(SQLite3Update, deleteNonexistent) {
|
|||||||
TEST_F(SQLite3Update, invalidDelete) {
|
TEST_F(SQLite3Update, invalidDelete) {
|
||||||
// An attempt of delete before an explicit start of transaction
|
// An attempt of delete before an explicit start of transaction
|
||||||
EXPECT_THROW(accessor->deleteRecordInZone(del_params), DataSourceError);
|
EXPECT_THROW(accessor->deleteRecordInZone(del_params), DataSourceError);
|
||||||
|
|
||||||
|
// Same for NSEC3.
|
||||||
|
EXPECT_THROW(accessor->deleteNSEC3RecordInZone(del_params),
|
||||||
|
DataSourceError);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SQLite3Update, emptyTransaction) {
|
TEST_F(SQLite3Update, emptyTransaction) {
|
||||||
|
Reference in New Issue
Block a user