From fa0f0f4e54028b860d8b3e5428016905d1d4b0ce Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 25 Jun 2019 18:59:15 -0400 Subject: [PATCH] copy-from-target: docker: Use tar to create files with the correct owner --- libexec/copy-from-target | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/copy-from-target b/libexec/copy-from-target index 1a00a12..e3c1bb7 100755 --- a/libexec/copy-from-target +++ b/libexec/copy-from-target @@ -47,7 +47,8 @@ if [ $# = 0 ] ; then fi if [ -n "$USE_DOCKER" ]; then - docker cp gitian-target:"/home/$TUSER/$1" $2 + # Use tar, so that files are created with the correct owner on the host + docker exec -u $TUSER gitian-target tar -C `dirname "$1"` -cf - `basename "$1"` | tar -C "$2" -xf - elif [ -z "$USE_LXC" ]; then src="${1%/}" # remove trailing / which triggers special rsync behaviour rsync --checksum -a $QUIET_FLAG -e "ssh -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_rsa -p $VM_SSH_PORT" "$TUSER@localhost:${src}" "$2"