]> 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:13:54 +0000 (10:13 -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 66108bb6be1903e90f3c730226befa764eb8a64a..052db9841e5b46f3d6956ddc4a2b11d0a1ff77b7 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);