aboutsummaryrefslogtreecommitdiffstats
path: root/src/bindfs.c
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2017-01-29 17:09:33 +0000
committerMartin Pärtel <martin.partel@gmail.com>2017-01-29 17:09:33 +0000
commit8f4b7de90989ab17260b6d7b926b2b71012475b3 (patch)
treede0b08e038cc2272c80d067502f248cdde0a3067 /src/bindfs.c
parent18300876c860cad126fb316a82509a95c002d766 (diff)
downloadbindfs-8f4b7de90989ab17260b6d7b926b2b71012475b3.tar.gz
Fixed #47 by not setting `-ofsname=` when it would contain a comma.
Also banned some other characters that are likely to lead to trouble.
Diffstat (limited to 'src/bindfs.c')
-rw-r--r--src/bindfs.c11
1 files changed, 9 insertions, 2 deletions
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);