main: do not copyup opaque xattr

when performing the copyup, do not copy the private xattrs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-01-15 17:52:13 +01:00
parent 214d606084
commit ce93abae5f
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

8
main.c
View File

@ -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;