upgrade to v1.6 ee7d74d75a727463046bf380b3de9e602a6e2b40

Signed-off-by: fundavid <fangjiawei8@huawei.com>
This commit is contained in:
fundavid
2025-03-04 11:03:27 +08:00
parent 3a2d23136c
commit 786fce4e10
13 changed files with 364 additions and 290 deletions
+17 -2
View File
@@ -12,8 +12,13 @@
#include "fsverity.h"
#include <fcntl.h>
#include <getopt.h>
#include <sys/ioctl.h>
static const struct option longopts[] = {
{NULL, 0, NULL, 0}
};
/* Display the fs-verity digest of the given verity file(s). */
int fsverity_cmd_measure(const struct fsverity_command *cmd,
int argc, char *argv[])
@@ -26,12 +31,22 @@ int fsverity_cmd_measure(const struct fsverity_command *cmd,
int status;
int i;
if (argc < 2)
/*
* No supported options, but run getopt_long() with an empty longopts
* array so that any options are rejected and "--" works as expected.
*/
if (getopt_long(argc, argv, "", longopts, NULL) != -1)
goto out_usage;
argv += optind;
argc -= optind;
if (argc < 1)
goto out_usage;
d = xzalloc(sizeof(*d) + FS_VERITY_MAX_DIGEST_SIZE);
for (i = 1; i < argc; i++) {
for (i = 0; i < argc; i++) {
d->digest_size = FS_VERITY_MAX_DIGEST_SIZE;
if (!open_file(&file, argv[i], O_RDONLY, 0))