]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Change find_fstype_cb to ignore blank lines and comments
authorYuto KAWAMURA(kawamuray) <kawamuray.dadada@gmail.com>
Fri, 4 Jul 2014 17:40:02 +0000 (02:40 +0900)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 7 Jul 2014 14:43:02 +0000 (10:43 -0400)
/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@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index 213511f2f924875c28ea052a6f43a4de81ebf57e..6882076c54ae591103d4781642758d7437e1a8e1 100644 (file)
@@ -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);