From 7339e320808451a52bc39cc9131dd7d93e5d9429 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Tue, 11 Aug 2026 21:01:47 +0200 Subject: [PATCH] xattrs: Use /proc/self/fd path in glnx_fd_get_all_xattrs This allows it to work on O_PATH file descriptors, which is needed for operating on symlinks. --- subprojects/libglnx/glnx-xattrs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subprojects/libglnx/glnx-xattrs.c b/subprojects/libglnx/glnx-xattrs.c index 84fd6094e..43423ac3c 100644 --- a/subprojects/libglnx/glnx-xattrs.c +++ b/subprojects/libglnx/glnx-xattrs.c @@ -229,8 +229,9 @@ glnx_fd_get_all_xattrs (int fd, GCancellable *cancellable, GError **error) { - return get_xattrs_impl (NULL, fd, out_xattrs, - cancellable, error); + char buf[PATH_MAX]; + snprintf (buf, sizeof (buf), "/proc/self/fd/%d", fd); + return get_xattrs_impl (buf, -1, out_xattrs, cancellable, error); } /**