Description: Fix handling of extended attributes on symlinks
Author: Hannes von Haugwitz <hannes@vonhaugwitz.com>
Origin: 04b34dd46292dedf830ef2366a86666869a31488
Date: Mon Jun 12 22:20:50 2023 +0200
Forwarded: not-needed
--- a/src/do_md.c
+++ b/src/do_md.c
@@ -565,7 +565,7 @@ void xattrs2line(db_line *line) {
                     strncmp(attr, "trusted.", strlen("trusted.")))
                 goto next_attr; /* only store normal xattrs, and SELinux */
 
-            while (((aret = getxattr(line->fullpath, attr, val, asz)) ==
+            while (((aret = lgetxattr(line->fullpath, attr, val, asz)) ==
                         -1) && (errno == ERANGE)) {
                 asz <<= 1;
                 val = realloc (val, asz);
@@ -574,7 +574,7 @@ void xattrs2line(db_line *line) {
             if (aret != -1)
                 xattr_add(xattrs, attr, val, aret);
             else if (errno != ENOATTR)
-                log_msg(LOG_LEVEL_WARNING, "getxattr failed for %s:%s", line->fullpath, strerror(errno));
+                log_msg(LOG_LEVEL_WARNING, "lgetxattr failed for %s:%s", line->fullpath, strerror(errno));
 
 next_attr:
             attr += len + 1;
