[lxc-devel] [PATCH 1/1] lxc-create: require absolute path for non-standard templates

Stéphane Graber stgraber at ubuntu.com
Mon Apr 1 14:06:54 UTC 2013


On 03/31/2013 06:00 PM, Serge Hallyn wrote:
> 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 at ubuntu.com>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/lxc-create.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in
> index fec5511..ebbdd7b 100644
> --- a/src/lxc/lxc-create.in
> +++ b/src/lxc/lxc-create.in
> @@ -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
> 


-- 
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: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130401/f1cf3a18/attachment.pgp>


More information about the lxc-devel mailing list