From: Mike Yuan Date: Mon, 31 Mar 2025 17:20:54 +0000 (+0200) Subject: validatefs: use fgetxattr_malloc() where appropriate X-Git-Tag: v258-rc1~978^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f361fad245161175af79a0fd8be7c1b5fa3f2587;p=thirdparty%2Fsystemd.git validatefs: use fgetxattr_malloc() where appropriate --- diff --git a/src/validatefs/validatefs.c b/src/validatefs/validatefs.c index 22345e5303e..2499a7e20fa 100644 --- a/src/validatefs/validatefs.c +++ b/src/validatefs/validatefs.c @@ -136,7 +136,7 @@ static int validate_fields_read(int fd, ValidateFields *ret) { assert(ret); _cleanup_free_ char *t = NULL; - r = getxattr_at_malloc(fd, /* path= */ NULL, "user.validatefs.gpt_type_uuid", AT_EMPTY_PATH, &t, /* ret_size= */ NULL); + r = fgetxattr_malloc(fd, "user.validatefs.gpt_type_uuid", &t, /* ret_size= */ NULL); if (r < 0) { if (r != -ENODATA && !ERRNO_IS_NOT_SUPPORTED(r)) return log_error_errno(r, "Failed to read 'user.validatefs.gpt_type_uuid' xattr: %m"); @@ -146,7 +146,7 @@ static int validate_fields_read(int fd, ValidateFields *ret) { return log_error_errno(r, "Failed to parse 'user.validatefs.gpt_type_uuid' xattr: %s", t); } - r = getxattr_at_malloc(fd, /* path= */ NULL, "user.validatefs.gpt_label", AT_EMPTY_PATH, &f.gpt_label, /* ret_size= */ NULL); + r = fgetxattr_malloc(fd, "user.validatefs.gpt_label", &f.gpt_label, /* ret_size= */ NULL); if (r < 0) { if (r != -ENODATA && !ERRNO_IS_NOT_SUPPORTED(r)) return log_error_errno(r, "Failed to read 'user.validatefs.gpt_label' xattr: %m");