[lxc-devel] [PATCH 1/1] lxc-create: refuse to use a custom rootfs (--dir) which already exists.
Stéphane Graber
stgraber at ubuntu.com
Wed Dec 5 16:48:59 UTC 2012
On 12/05/2012 11:38 AM, Serge Hallyn wrote:
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
Pushed to staging. Thanks
> ---
> src/lxc/lxc-create.in | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in
> index 650a245..3c66bfa 100644
> --- a/src/lxc/lxc-create.in
> +++ b/src/lxc/lxc-create.in
> @@ -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
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20121205/36357fa5/attachment.pgp>
More information about the lxc-devel
mailing list