veritysetup-generator: exit on first error

This commit is contained in:
Lennart Poettering
2025-03-19 16:32:02 +01:00
parent 0ec1a83eea
commit eedd0b9886
+3 -6
View File
@@ -65,14 +65,11 @@ static int create_special_device(
/* if one of them is missing however, the data is simply incomplete and this is an error */
if (!roothash)
log_error("Verity information for %s incomplete, root hash unspecified.", name);
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Verity information for %s incomplete, root hash unspecified.", name);
if (!data_what)
log_error("Verity information for %s incomplete, data device unspecified.", name);
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Verity information for %s incomplete, data device unspecified.", name);
if (!hash_what)
log_error("Verity information for %s incomplete, hash device unspecified.", name);
if (!roothash || !data_what || !hash_what)
return -EINVAL;
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Verity information for %s incomplete, hash device unspecified.", name);
_cleanup_free_ char *service = NULL;
r = unit_name_build("systemd-veritysetup", name, ".service", &service);