[lxc-devel] [PATCH] Change find_fstype_cb to ignore blank lines and comments

Serge Hallyn serge.hallyn at ubuntu.com
Mon Jul 7 14:11:20 UTC 2014


Quoting Yuto KAWAMURA(kawamuray) (kawamuray.dadada at gmail.com):
> /etc/filesystems could be contain blank lines and comments.
> Change find_fstype_cb() to ignore blank lines and comments which starts
> with '#'.
> 
> Signed-off-by: Yuto KAWAMURA(kawamuray) <kawamuray.dadada at gmail.com>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/lxc/conf.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/lxc/conf.c b/src/lxc/conf.c
> index 66108bb..052db98 100644
> --- a/src/lxc/conf.c
> +++ b/src/lxc/conf.c
> @@ -447,6 +447,10 @@ static int find_fstype_cb(char* buffer, void *data)
>  	fstype += lxc_char_left_gc(fstype, strlen(fstype));
>  	fstype[lxc_char_right_gc(fstype, strlen(fstype))] = '\0';
>  
> +	/* ignore blank line and comment */
> +	if (fstype[0] == '\0' || fstype[0] == '#')
> +		return 0;
> +
>  	DEBUG("trying to mount '%s'->'%s' with fstype '%s'",
>  	      cbarg->rootfs, cbarg->target, fstype);
>  
> -- 
> 1.8.5.5
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list