From fecf906ce5028679f24e3b2c20408a77e8607f52 Mon Sep 17 00:00:00 2001 From: Petros Angelatos Date: Sun, 2 Aug 2015 20:35:49 +0100 Subject: [PATCH] enter.sh: Split env vars by NULL byte instead of whitespace --- bin/enter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/enter.sh b/bin/enter.sh index 35b83508..012c2f5b 100644 --- a/bin/enter.sh +++ b/bin/enter.sh @@ -10,5 +10,5 @@ CONTAINER_PID=$($ENGINE inspect --format '{{if .State.Running}}{{.State.Pid}}{{e if [ -z $CONTAINER_PID ]; then read -p "Application must be running for a terminal to be started." else - nsenter --target $CONTAINER_PID --mount --uts --ipc --net --pid -- bash -c 'export $(xargs -n 1 -0 < /proc/1/environ); exec bash' + nsenter --target $CONTAINER_PID --mount --uts --ipc --net --pid -- bash -c 'while IFS= read -r -d "" var; do export "$var"; done < /proc/1/environ; exec bash' fi