]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxc-create: require absolute path for non-standard templates
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Sun, 31 Mar 2013 22:00:10 +0000 (17:00 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 1 Apr 2013 14:06:59 +0000 (10:06 -0400)
Otherwise, as an example, if doing 'lxc-create -t debian' while
there is a 'debian' directory, lxc-create will fail to do the
right thing.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxc-create.in

index fec551160a0b0d5b5e304c609934cd7f30576ad0..ebbdd7b4214f2cd7acf6c9fb6d748923bf35367f 100644 (file)
@@ -291,7 +291,7 @@ fi
 
 if [ ! -z "$lxc_template" ]; then
     # Allow for a path to be provided as the template name
-    if [ -x "$lxc_template" ]; then
+    if [ -x "$lxc_template" -a $(echo "$lxc_template" | cut -c 1) = '/' ]; then
         template_path=$lxc_template
     else
         template_path=${templatedir}/lxc-$lxc_template