Skip to content

Commit

Permalink
writer: Canonicalize no-verity errno to -ENOVERITY
Browse files Browse the repository at this point in the history
This is what we do elsewhere.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Nov 6, 2024
1 parent 0092415 commit 73276cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libcomposefs/lcfs-writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ int lcfs_fd_require_fsverity(uint8_t *digest, int fd)
fsv->digest_size = MAX_DIGEST_SIZE;
int res = ioctl(fd, FS_IOC_MEASURE_VERITY, fsv);
if (res == -1) {
if (errno == ENODATA || errno == EOPNOTSUPP || errno == ENOTTY)
return -ENOVERITY;
return -errno;
}
// The file has fsverity enabled, but with an unexpected different algorithm (e.g. sha512).
Expand Down

0 comments on commit 73276cf

Please sign in to comment.