From 887ba4eb7a3f826f3e7c1a9c1de8f9fa71ddee95 Mon Sep 17 00:00:00 2001 From: Dario Freni Date: Tue, 21 Dec 2021 17:22:46 +0000 Subject: [PATCH] Fix logic to avoid copying selinux context xattr. --- toys/posix/cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/posix/cp.c b/toys/posix/cp.c index 7e7aa100..fe021cde 100644 --- a/toys/posix/cp.c +++ b/toys/posix/cp.c @@ -282,7 +282,7 @@ static int cp_node(struct dirtree *try) xattr_flist(fdin, list, listlen); list[listlen-1] = 0; // I do not trust this API. for (name = list; name-list < listlen; name += strlen(name)+1) { - if (!(TT.pflags&_CP_xattr) && strncmp(name, "security.", 9)) + if (!(TT.pflags&_CP_context) && (strncmp(name, "security.", 9) == 0)) continue; if ((len = xattr_fget(fdin, name, 0, 0))>0) { value = xmalloc(len); -- 2.39.2