From a2f474d9c53c605d45332c2361a2745f874de64b Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Thu, 11 Jul 2024 11:11:55 +0200 Subject: [PATCH] - added checks --- barrel/create-encryption.cc | 4 ++++ barrel/create-filesystem.cc | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/barrel/create-encryption.cc b/barrel/create-encryption.cc index dd334b1..da61cd0 100644 --- a/barrel/create-encryption.cc +++ b/barrel/create-encryption.cc @@ -205,6 +205,10 @@ namespace barrel void Options::check() const { + if (activate_by && activate_by.value() == MountByType::LABEL && !label) + { + throw runtime_error(_("activate-by label requires a label")); + } } } diff --git a/barrel/create-filesystem.cc b/barrel/create-filesystem.cc index 3ddccd2..7c65585 100644 --- a/barrel/create-filesystem.cc +++ b/barrel/create-filesystem.cc @@ -321,6 +321,11 @@ namespace barrel throw runtime_error(_("mount options require a path")); } + if (mount_by && mount_by.value() == MountByType::LABEL && !label) + { + throw runtime_error(_("mount-by label requires a label")); + } + if (number && !supports_multiple_devices(type.value())) { throw runtime_error(sformat(_("option --devices not allowed for %s"),