From ce93abae5fcb3be98867bbfd8e13abb2c086d1c2 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 15 Jan 2020 17:52:13 +0100 Subject: [PATCH] main: do not copyup opaque xattr when performing the copyup, do not copy the private xattrs. Signed-off-by: Giuseppe Scrivano --- main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index ca459c1..cefd3c5 100644 --- a/main.c +++ b/main.c @@ -2328,7 +2328,13 @@ copy_xattr (int sfd, int dfd, char *buf, size_t buf_size) for (it = buf; it - buf < xattr_len; it += strlen (it) + 1) { cleanup_free char *v = NULL; - ssize_t s = safe_read_xattr (&v, sfd, it, 256); + ssize_t s; + + if (has_prefix (it, XATTR_PREFIX) + || has_prefix (it, PRIVILEGED_XATTR_PREFIX)) + continue; + + s = safe_read_xattr (&v, sfd, it, 256); if (s < 0) return -1;