From 8f4b7de90989ab17260b6d7b926b2b71012475b3 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Sun, 29 Jan 2017 17:09:33 +0000 Subject: Fixed #47 by not setting `-ofsname=` when it would contain a comma. Also banned some other characters that are likely to lead to trouble. --- src/bindfs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/bindfs.c b/src/bindfs.c index 6ba9e68..c87b3d8 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -2155,8 +2155,15 @@ int main(int argc, char *argv[]) fuse_opt_add_arg(&args, "-ouse_ino"); fuse_opt_add_arg(&args, "-oreaddir_ino"); - /* Show the source dir in the first field on /etc/mtab. */ - { + /* Show the source dir in the first field on /etc/mtab, to be consistent + with "real" filesystems. + + We don't do this if the source dir contains some special characters. + Comma is on this list because it would mess up FUSE's option parsing + (issue #47). The character blacklist is likely not complete, which is + acceptable since this is not a security check. The aim is to avoid giving + the user a confusing error. */ + if (strpbrk(settings.mntsrc, ", \t\n") == NULL) { char *tmp = sprintf_new("-ofsname=%s", settings.mntsrc); fuse_opt_add_arg(&args, tmp); free(tmp); -- cgit v1.2.3