From: Serge Hallyn <serge.hal...@ubuntu.com>

Up to now lxc-create ensured that you were running as root.  Now the
templates which require root need to do it for themselves.  Templates
which do mknod definately require root.

Signed-off-by: Serge Hallyn <serge.hal...@ubuntu.com>
---
 templates/lxc-alpine.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in
index be2a535..ce7226f 100644
--- a/templates/lxc-alpine.in
+++ b/templates/lxc-alpine.in
@@ -250,6 +250,12 @@ default_path=@LXCPATH@
 release=
 arch=$(uname -m)
 
+# template mknods, requires root
+if [ $(id -u) -ne 0 ]; then
+   echo "$(basename $0): must be run as root" >&2
+   exit 1
+fi
+
 while [ $# -gt 0 ]; do
     opt="$1"
     shift
-- 
1.8.3.2


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to