From 7d2ff3afeb768b610867861489152e0c31ade16d Mon Sep 17 00:00:00 2001 From: John Tyner Date: Tue, 24 Sep 2019 20:04:29 -0700 Subject: [PATCH 1/4] Remove 'FUSE-' prefix from file system name when using fuse interface --- src/dll/fuse/fuse.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dll/fuse/fuse.c b/src/dll/fuse/fuse.c index cb0bd7b9..a3a827e0 100644 --- a/src/dll/fuse/fuse.c +++ b/src/dll/fuse/fuse.c @@ -360,12 +360,11 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key, else if ('F' == arg[2]) arg += sizeof "--FileSystemName=" - 1; if (0 == MultiByteToWideChar(CP_UTF8, 0, arg, -1, - opt_data->VolumeParams.FileSystemName + 5, - sizeof opt_data->VolumeParams.FileSystemName / sizeof(WCHAR) - 5)) + opt_data->VolumeParams.FileSystemName, + sizeof opt_data->VolumeParams.FileSystemName / sizeof(WCHAR))) return -1; opt_data->VolumeParams.FileSystemName [sizeof opt_data->VolumeParams.FileSystemName / sizeof(WCHAR) - 1] = L'\0'; - memcpy(opt_data->VolumeParams.FileSystemName, L"FUSE-", 5 * sizeof(WCHAR)); return 0; case 'u': if ('U' == arg[0]) From c9d3cb74c748159e9fa7933206b8383739132a0c Mon Sep 17 00:00:00 2001 From: John Tyner Date: Wed, 25 Sep 2019 16:20:50 -0700 Subject: [PATCH 2/4] add John Tyner to contributors --- Contributors.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/Contributors.asciidoc b/Contributors.asciidoc index 83430e25..363c4c92 100644 --- a/Contributors.asciidoc +++ b/Contributors.asciidoc @@ -61,6 +61,7 @@ CONTRIBUTOR LIST |Francois Karam (KS2, http://www.ks2.fr) |francois.karam at ks2.fr |Fritz Elfert |fritz-github at fritz-elfert.de |John Oberschelp |john at oberschelp.net +|John Tyner |jtyner at gmail.com |Sam Kelly (DuroSoft Technologies LLC, https://durosoft.com) |sam at durosoft.com |Santiago Ganis |sganis at gmail.com |Tobias Urlaub |saibotu at outlook.de From 490d0577bb7fa1cebf972f5f3f68200fc418b860 Mon Sep 17 00:00:00 2001 From: John Tyner Date: Mon, 7 Oct 2019 06:47:02 -0700 Subject: [PATCH 3/4] Revert "Remove 'FUSE-' prefix from file system name when using fuse interface" This reverts commit 7d2ff3afeb768b610867861489152e0c31ade16d. --- src/dll/fuse/fuse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dll/fuse/fuse.c b/src/dll/fuse/fuse.c index a3a827e0..cb0bd7b9 100644 --- a/src/dll/fuse/fuse.c +++ b/src/dll/fuse/fuse.c @@ -360,11 +360,12 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key, else if ('F' == arg[2]) arg += sizeof "--FileSystemName=" - 1; if (0 == MultiByteToWideChar(CP_UTF8, 0, arg, -1, - opt_data->VolumeParams.FileSystemName, - sizeof opt_data->VolumeParams.FileSystemName / sizeof(WCHAR))) + opt_data->VolumeParams.FileSystemName + 5, + sizeof opt_data->VolumeParams.FileSystemName / sizeof(WCHAR) - 5)) return -1; opt_data->VolumeParams.FileSystemName [sizeof opt_data->VolumeParams.FileSystemName / sizeof(WCHAR) - 1] = L'\0'; + memcpy(opt_data->VolumeParams.FileSystemName, L"FUSE-", 5 * sizeof(WCHAR)); return 0; case 'u': if ('U' == arg[0]) From 8f903057266e1b1d654f8f974efa815cf93f91f8 Mon Sep 17 00:00:00 2001 From: John Tyner Date: Mon, 7 Oct 2019 07:05:01 -0700 Subject: [PATCH 4/4] add support for setting file system name without 'FUSE-' prefix --- src/dll/fuse/fuse.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/dll/fuse/fuse.c b/src/dll/fuse/fuse.c index cb0bd7b9..38648188 100644 --- a/src/dll/fuse/fuse.c +++ b/src/dll/fuse/fuse.c @@ -102,6 +102,8 @@ static struct fuse_opt fsp_fuse_core_opts[] = FUSE_OPT_KEY("--VolumePrefix=", 'U'), FUSE_OPT_KEY("FileSystemName=", 'F'), FUSE_OPT_KEY("--FileSystemName=", 'F'), + FUSE_OPT_KEY("ExactFileSystemName=", 'E'), + FUSE_OPT_KEY("--ExactFileSystemName=", 'E'), FSP_FUSE_CORE_OPT("UserName=", set_uid, 1), FUSE_OPT_KEY("UserName=", 'u'), @@ -367,6 +369,18 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key, [sizeof opt_data->VolumeParams.FileSystemName / sizeof(WCHAR) - 1] = L'\0'; memcpy(opt_data->VolumeParams.FileSystemName, L"FUSE-", 5 * sizeof(WCHAR)); return 0; + case 'E': + if ('E' == arg[0]) + arg += sizeof "ExactFileSystemName=" - 1; + else if ('E' == arg[2]) + arg += sizeof "--ExactFileSystemName=" - 1; + if (0 == MultiByteToWideChar(CP_UTF8, 0, arg, -1, + opt_data->VolumeParams.FileSystemName, + sizeof opt_data->VolumeParams.FileSystemName / sizeof(WCHAR))) + return -1; + opt_data->VolumeParams.FileSystemName + [sizeof opt_data->VolumeParams.FileSystemName / sizeof(WCHAR) - 1] = L'\0'; + return 0; case 'u': if ('U' == arg[0]) arg += sizeof "UserName=" - 1;