From 054e35b9ef9943ad6326092f93b873b1495d9540 Mon Sep 17 00:00:00 2001 From: stefanf Date: Thu, 11 Oct 2012 07:54:29 +0000 Subject: Decode the first two fstab fields with strunvis(3). This allows having spaces in devices and mount paths, encoded as \s or \040. PR: bin/117687 Submitted by: Martin Kammerhofer Discussed on: arch --- lib/libc/gen/fstab.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/libc/gen/fstab.c') diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c index 356b871..1351a27 100644 --- a/lib/libc/gen/fstab.c +++ b/lib/libc/gen/fstab.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "un-namespace.h" static FILE *_fs_fp; @@ -149,11 +150,15 @@ fstabscan(void) /* OLD_STYLE_FSTAB */ while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') ; + if (strunvis(cp, cp) < 0) + goto bad; _fs_fstab.fs_spec = cp; if (!_fs_fstab.fs_spec || *_fs_fstab.fs_spec == '#') continue; while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') ; + if (strunvis(cp, cp) < 0) + goto bad; _fs_fstab.fs_file = cp; fixfsfile(); while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') -- cgit v1.1