From 4d58cf166b8c0b90fa28fa4f77fc718df6988688 Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Thu, 11 Jul 2024 13:05:56 +0200 Subject: [PATCH] - check that name of encryption is unique --- barrel/create-encryption.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/barrel/create-encryption.cc b/barrel/create-encryption.cc index da61cd0..38feca9 100644 --- a/barrel/create-encryption.cc +++ b/barrel/create-encryption.cc @@ -240,6 +240,12 @@ namespace barrel { Devicegraph* staging = state.storage->get_staging(); + for (const Encryption* encryption : Encryption::get_all(staging)) + { + if (encryption->get_dm_table_name() == options.name) + throw runtime_error(_("name of encryption already exists")); + } + EncryptionType type = options.type.value(); string dm_name = options.name;