]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-create: refuse to use a custom rootfs (--dir) which already exists.
authorSerge Hallyn <serge.hallyn@canonical.com>
Wed, 5 Dec 2012 16:38:07 +0000 (10:38 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 5 Dec 2012 16:48:10 +0000 (11:48 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxc-create.in

index 650a245a3dbaf6ab0f686c8c2b7a73b3e1e1bbd8..3c66bfa7b592ae2a51f4110a4d93f47dedfe8960 100644 (file)
@@ -313,6 +313,10 @@ if [ -n "$custom_rootfs" ]; then
         echo "configuration file already specifies a lxc.rootfs"
         exit 1
     fi
+    if [ -d "$custom_rootfs" ]; then
+        echo "specified rootfs ($custom_rootfs) already exists.  Bailing."
+        exit 1
+    fi
     echo "lxc.rootfs = $custom_rootfs" >> $lxc_path/$lxc_name/config
 fi