summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab_parse.c
diff options
context:
space:
mode:
authorOndrej Oprala2013-01-10 12:35:08 +0100
committerKarel Zak2013-01-10 14:52:24 +0100
commite47a19312ff91de3c4ead99714b8bfa06139809e (patch)
tree10af2946745dab0416cc97e74c5c4ce0c2b8bf90 /libmount/src/tab_parse.c
parentlibmount: fix regression test helper (diff)
downloadkernel-qcow2-util-linux-e47a19312ff91de3c4ead99714b8bfa06139809e.tar.gz
kernel-qcow2-util-linux-e47a19312ff91de3c4ead99714b8bfa06139809e.tar.xz
kernel-qcow2-util-linux-e47a19312ff91de3c4ead99714b8bfa06139809e.zip
libmount: read optional mountinfo fields
[kzak@redhat.com: - rename struct member and functions from "propagation" to "optional fields" - split the original patch - fix parser] Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab_parse.c')
-rw-r--r--libmount/src/tab_parse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
index 56da8ec47..a8b7b79d4 100644
--- a/libmount/src/tab_parse.c
+++ b/libmount/src/tab_parse.c
@@ -161,6 +161,8 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s)
DBG(TAB, mnt_debug("mountinfo parse error: not found separator"));
return -EINVAL;
}
+ if (p > s + 1)
+ fs->opt_fields = strndup(s + 1, p - s - 1);
s = p + 3;
rc += sscanf(s, UL_SCNsA" " /* (8) FS type */