diff options
Diffstat (limited to 'src/integritysetup')
-rw-r--r-- | src/integritysetup/integritysetup.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/integritysetup/integritysetup.c b/src/integritysetup/integritysetup.c index f95840a8d0..924c15b6eb 100644 --- a/src/integritysetup/integritysetup.c +++ b/src/integritysetup/integritysetup.c @@ -124,6 +124,9 @@ static int run(int argc, char *argv[]) { key_file = mangle_none(argc > 4 ? argv[4] : NULL); options = mangle_none(argc > 5 ? argv[5] : NULL); + if (!filename_is_valid(volume)) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Volume name '%s' is not valid.", volume); + if (key_file) { r = load_key_file(key_file, &key_buf, &key_buf_size); if (r < 0) @@ -174,6 +177,9 @@ static int run(int argc, char *argv[]) { if (argc > 3) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "detach has a maximum of two arguments."); + if (!filename_is_valid(volume)) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Volume name '%s' is not valid.", volume); + r = crypt_init_by_name(&cd, volume); if (r == -ENODEV) { log_info("Volume %s already inactive.", volume); |