[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] cpio: don't complain about unsafe symlink target when using -p
From:       soeren () soeren-tempel ! net
Date:       2018-03-12 11:45:12
Message-ID: 20180312114512.8445-1-soeren () soeren-tempel ! net
[Download RAW message or body]

From: Sören Tempel <soeren+git@soeren-tempel.net>

Without this patch busybox complains about unsafe symlink target even
when you are just copying files to a directory since OPT_EXTRACT is set
by the main function when -p is being used.

This patch is kind of ugly. An alternative solution would be not calling
get_header_cpio when -p is being used.
---
 archival/cpio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/archival/cpio.c b/archival/cpio.c
index 1d6cbd1e2..9aa23ece1 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -449,6 +449,7 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
 		xmove_fd(pp.rd, STDIN_FILENO);
 		//opt &= ~OPT_PASSTHROUGH;
 		opt |= OPT_EXTRACT;
+		setenv("EXTRACT_UNSAFE_SYMLINKS", "1", 1);
 		goto skip;
 	}
 	/* -o */
-- 
2.16.2

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic