Skip to content

Commit

Permalink
- added checks
Browse files Browse the repository at this point in the history
  • Loading branch information
aschnell committed Jul 11, 2024
1 parent 63e0809 commit a2f474d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions barrel/create-encryption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
}

}
Expand Down
5 changes: 5 additions & 0 deletions barrel/create-filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit a2f474d

Please sign in to comment.