[lxc-devel] [PATCH] lxc-test-{unpriv, usernic.in}: make sure to chgrp as well

Serge Hallyn serge.hallyn at ubuntu.com
Thu Jul 17 21:04:09 UTC 2014


These tests are failing on new kernels because the container root is
not privileged over the directories, since privilege no requires
the group being mapped into the container.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/tests/lxc-test-unpriv     | 6 +++---
 src/tests/lxc-test-usernic.in | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv
index 5ab7524..f5ab535 100755
--- a/src/tests/lxc-test-unpriv
+++ b/src/tests/lxc-test-unpriv
@@ -84,10 +84,10 @@ lxc.network.link = lxcbr0
 lxc.id_map = u 0 910000 9999
 lxc.id_map = g 0 910000 9999
 EOF
-chown -R $TUSER $HDIR
+chown -R $TUSER: $HDIR
 
 mkdir -p /run/user/$(id -u $TUSER)
-chown -R $TUSER /run/user/$(id -u $TUSER)
+chown -R $TUSER: /run/user/$(id -u $TUSER)
 
 cd $HDIR
 
@@ -108,7 +108,7 @@ if [ -e /sys/fs/cgroup/cgmanager/sock ]; then
 else
 	for d in /sys/fs/cgroup/*; do
 		[ ! -d $d/lxctest ] && mkdir $d/lxctest
-		chown -R $TUSER $d/lxctest
+		chown -R $TUSER: $d/lxctest
 		echo $$ > $d/lxctest/tasks
 	done
 fi
diff --git a/src/tests/lxc-test-usernic.in b/src/tests/lxc-test-usernic.in
index ad11f0a..395c453 100755
--- a/src/tests/lxc-test-usernic.in
+++ b/src/tests/lxc-test-usernic.in
@@ -74,7 +74,7 @@ trap cleanup EXIT SIGHUP SIGINT SIGTERM
 deluser usernic-user || true
 useradd usernic-user
 sudo mkdir -p /home/usernic-user
-sudo chown usernic-user /home/usernic-user
+sudo chown usernic-user: /home/usernic-user
 usermod -v 910000-919999 -w 910000-919999 usernic-user
 
 mkdir -p /home/usernic-user/.config/lxc/
@@ -101,13 +101,13 @@ if [ -e /sys/fs/cgroup/cgmanager/sock ]; then
 else
 	for d in /sys/fs/cgroup/*; do
 		[ ! -d $d/lxctest ] && mkdir $d/lxctest
-		chown -R usernic-user $d/lxctest
+		chown -R usernic-user: $d/lxctest
 		echo $$ > $d/lxctest/tasks
 	done
 fi
 
 mkdir -p /run/user/$(id -u usernic-user)
-chown -R usernic-user /run/user/$(id -u usernic-user) /home/usernic-user
+chown -R usernic-user: /run/user/$(id -u usernic-user) /home/usernic-user
 
 # Create two test bridges
 brctl addbr usernic-br0
-- 
1.9.1



More information about the lxc-devel mailing list