Skip to content

Commit

Permalink
Merge devrandom#220: copy-from-target: docker: Use tar to create file…
Browse files Browse the repository at this point in the history
…s with the correct owner

fa0f0f4 copy-from-target: docker: Use tar to create files with the correct owner (MarcoFalke)
  • Loading branch information
devrandom committed Aug 1, 2019
2 parents de6a592 + fa0f0f4 commit 9b28e9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libexec/copy-from-target
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9b28e9c

Please sign in to comment.