[lxc-devel] [PATCH 1/1] put quotes around $line to avoid expansion of its contents.

Serge Hallyn serge.hallyn at canonical.com
Wed May 2 20:27:11 UTC 2012


Otherwise things like '*:*' in config can get expanded if there is a
matching filename in cwd.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/lxc/lxc-clone.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/lxc-clone.in b/src/lxc/lxc-clone.in
index 28c47e8..c9a8691 100644
--- a/src/lxc/lxc-clone.in
+++ b/src/lxc/lxc-clone.in
@@ -275,7 +275,7 @@ while read line; do
 	if [ "${line:0:18}" = "lxc.network.hwaddr" ]; then
 		echo "lxc.network.hwaddr= 00:16:3e:$(openssl rand -hex 3| sed 's/\(..\)/\1:/g; s/.$//')"
 	else
-		echo $line
+		echo "$line"
 	fi
 done
 ) < ${c}.old > ${c}
-- 
1.7.9.5





More information about the lxc-devel mailing list