Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 769359 - sys-apps/install-xattr - allow installing files from filesystems without xattr
Summary: sys-apps/install-xattr - allow installing files from filesystems without xattr
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
: 931675 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-07 17:57 UTC by Jaak Ristioja
Modified: 2024-08-19 02:09 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-install-xattr-do-to-fail-if-source-filesystem-does-n.patch (0001-install-xattr-do-to-fail-if-source-filesystem-does-n.patch,1.24 KB, patch)
2024-06-18 06:56 UTC, Florian Schmaus
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaak Ristioja 2021-02-07 17:57:44 UTC
If the Gentoo repository (i.e. /var/db/repos/gentoo) is on a filesystem without xattr support, emerging packages like net-mail/mailbase or app-arch/tar fails on hardened (i.e. default/linux/amd64/17.1/no-multilib/hardened), due to install-xattr failing to retrieve the extended attributes of certain files:

  install-xattr: listxattr() failed: Operation not supported

According to strace:

  listxattr("/var/tmp/portage/net-mail/mailbase-1.5-r2/files/mailcap.5", NULL, 0) = -1 EOPNOTSUPP (Operation not supported)

where /var/tmp/portage/net-mail/mailbase-1.5-r2/files is actually a symlink to /var/db/repos/gentoo/net-mail/mailbase/files during the merge.

During debugging this I wasted quite a lot of time trying to figure out what is wrong with the xattr support on my /var/tmp/portage/ filesystem (which does have xattr support) before I found that the FILESDIR was actually a symlink to the other filesystem.

Please add support for repositories on filesystems without xattr or provide better diagnostics. Should extended attributes from files residing on different filesystems than ${PORTAGE_BUILDDIR} at all be considered for copying?

Thanks!
Comment 1 Mike Gilbert gentoo-dev 2024-05-12 18:52:52 UTC
*** Bug 931675 has been marked as a duplicate of this bug. ***
Comment 2 Florian Schmaus gentoo-dev 2024-06-18 06:56:14 UTC
Created attachment 895998 [details, diff]
0001-install-xattr-do-to-fail-if-source-filesystem-does-n.patch

Attached patch should fix this.
Comment 3 Mark G. Woodruff 2024-08-19 02:09:40 UTC
Needs something similar xlistattr(), which is causing emerging linux-firmware to fail. This handles both:

--- install-xattr/install-xattr.c       2024-08-18 21:52:42.316666599 -0400
+++ install-xattr/install-xattr.c       2024-08-18 22:02:32.773333234 -0400
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <err.h>
+#include <errno.h>
 #include <fnmatch.h>
 #include <ctype.h>
 #include <getopt.h>
@@ -80,6 +81,7 @@
 xlistxattr(const char *path, char *list, size_t size)
 {
        ssize_t ret = listxattr(path, list, size);
+       if (ret < 0 && errno == ENOTSUP) ret=0;
        if (ret < 0)
                err(1, "listxattr() failed");
        return ret;
@@ -89,6 +91,7 @@
 xgetxattr(const char *path, char *list, char *value, size_t size)
 {
        ssize_t ret = getxattr(path, list, value, size);
+       if (ret < 0 && errno == ENOTSUP) ret=0;
        if (ret < 0)
                err(1, "getxattr() failed");
        return ret;