[lxc-devel] [PATCH 1/3] Bad checking of getconfig key

Clément Calmels clement.calmels at fr.ibm.com
Thu Sep 16 14:13:43 UTC 2010


This serie brings some new issues. Will rework on it.

c.

On jeu, 2010-09-16 at 16:05 +0200, Clement Calmels wrote:
> Without this patch all false config key that looks like a real one are
> valid. For example:
> 
>  lxc-execute -n foo -s 'lxc.utsnamebug= bar'
> 
> With this patch it now raises an error:
> 
> $ lxc-execute -n foo -s 'lxc.utsnamebug= bar' -- uname -a
> lxc-execute: unknow key lxc.utsnamebug
> 
> Signed-off-by: Clement Calmels <clement.calmels at fr.ibm.com>
> ---
> 
>  src/lxc/confile.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lxc/confile.c b/src/lxc/confile.c
> index 610ca15..76fa9ac 100644
> --- a/src/lxc/confile.c
> +++ b/src/lxc/confile.c
> @@ -107,8 +107,7 @@ static struct config *getconfig(const char *key)
>  	int i;
>  
>  	for (i = 0; i < config_size; i++)
> -		if (!strncmp(config[i].name, key,
> -			     strlen(config[i].name)))
> +		if (!strcmp(config[i].name, key))
>  			return &config[i];
>  	return NULL;
>  }
> 
> 
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel





More information about the lxc-devel mailing list