From d88a0c42e17346c19c9951d0e87ef9fd9f5ecf36 Mon Sep 17 00:00:00 2001 From: Roberto Sassu Date: Tue, 16 Jun 2020 19:40:36 +0200 Subject: [PATCH] Ignore -ENOTSUP error from setxattr() --- lib/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/xattr.c b/lib/xattr.c index 70a1b79..6f047c2 100644 --- a/lib/xattr.c +++ b/lib/xattr.c @@ -59,7 +59,7 @@ int write_ima_xattr(int dirfd, char *path, u8 *keyid, size_t keyid_len, xattr_buf, xattr_buf_len, 0); } out: - if (ret < 0) + if (ret < 0 && errno != ENOTSUP) printf("Cannot add %s xattr to %s: %s\n", XATTR_NAME_IMA, path, strerror(errno)); @@ -78,7 +78,7 @@ int write_evm_xattr(char *path, enum hash_algo algo) ret = lsetxattr(path, XATTR_NAME_EVM, &hdr, offsetof(struct signature_v2_hdr, keyid), 0); - if (ret < 0) + if (ret < 0 && errno != ENOTSUP) printf("Cannot add %s xattr to %s: %s\n", XATTR_NAME_EVM, path, strerror(errno)); @@ -161,7 +161,7 @@ int gen_write_ima_xattr(u8 *buf, int *buf_len, char *path, u8 algo, u8 *digest, return 0; ret = lsetxattr(path, XATTR_NAME_IMA, buf, *buf_len, 0); - if (ret < 0) + if (ret < 0 && errno != ENOTSUP) printf("Cannot add %s xattr to %s: %s\n", XATTR_NAME_IMA, path, strerror(errno)); -- GitLab