]> git.proxmox.com Git - mirror_lxc.git/commitdiff
templates: require running as root
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 9 May 2013 01:15:29 +0000 (20:15 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 22 Jul 2013 17:14:22 +0000 (12:14 -0500)
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.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-alpine.in

index be2a5357f72de1ac6f6d9f5dbbbf704bca9c1099..ce7226f73b144c213782f55cffc204f64765543d 100644 (file)
@@ -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