From 9dcc04f882f67fb28929dfcfae346ad5233fd694 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Mon, 15 Apr 2019 15:34:35 -0700 Subject: [PATCH 1/5] tools: update deploy/debug scripts --- tools/debug.bat | 2 +- tools/deploy.bat | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/debug.bat b/tools/debug.bat index b65d72cf..8ed7ae73 100755 --- a/tools/debug.bat +++ b/tools/debug.bat @@ -4,7 +4,7 @@ setlocal set DebugWorkspace=winfsp set DebugPort=50000 -set DebugKey=win8.debug.net.key +set DebugKey=1.1.1.1 set RegKey="HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" set RegVal="KitsRoot10" diff --git a/tools/deploy.bat b/tools/deploy.bat index 7a059940..27ffb11d 100755 --- a/tools/deploy.bat +++ b/tools/deploy.bat @@ -5,6 +5,7 @@ setlocal set CONFIG=Debug set SUFFIX=x64 set TARGET_MACHINE=WIN8DBG +if not X%1==X set TARGET_MACHINE=%1 set TARGET_ACCOUNT=\Users\%USERNAME%\Downloads\winfsp\ set TARGET=\\%TARGET_MACHINE%%TARGET_ACCOUNT% From 8beb534340fd0232129aff6553530d1baee8731f Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Mon, 15 Apr 2019 16:30:00 -0700 Subject: [PATCH 2/5] dll: fuse: dot_hidden option adds hidden file attribute on dot files --- src/dll/fuse/fuse.c | 5 +++++ src/dll/fuse/fuse_intf.c | 11 ++++++++++- src/dll/fuse/library.h | 4 +++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/dll/fuse/fuse.c b/src/dll/fuse/fuse.c index 437a2f9f..55745328 100644 --- a/src/dll/fuse/fuse.c +++ b/src/dll/fuse/fuse.c @@ -71,6 +71,9 @@ static struct fuse_opt fsp_fuse_core_opts[] = FSP_FUSE_CORE_OPT("rellinks", rellinks, 1), FSP_FUSE_CORE_OPT("norellinks", rellinks, 0), + FSP_FUSE_CORE_OPT("dot_hidden", dot_hidden, 1), + FSP_FUSE_CORE_OPT("nodot_hidden", dot_hidden, 0), + FUSE_OPT_KEY("fstypename=", 'F'), FUSE_OPT_KEY("volname=", 'v'), @@ -244,6 +247,7 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key, " -o uid=N set file owner (-1 for mounting user id)\n" " -o gid=N set file group (-1 for mounting user group)\n" " -o rellinks interpret absolute symlinks as volume relative\n" + " -o dot_hidden dot files have the Windows hidden file attrib\n" " -o volname=NAME set volume label\n" " -o VolumePrefix=UNC set UNC prefix (/Server/Share)\n" " --VolumePrefix=UNC set UNC prefix (\\Server\\Share)\n" @@ -425,6 +429,7 @@ FSP_FUSE_API struct fuse *fsp_fuse_new(struct fsp_fuse_env *env, f->set_uid = opt_data.set_uid; f->uid = opt_data.uid; f->set_gid = opt_data.set_gid; f->gid = opt_data.gid; f->rellinks = opt_data.rellinks; + f->dot_hidden = opt_data.dot_hidden; f->ThreadCount = opt_data.ThreadCount; memcpy(&f->ops, ops, opsize); f->data = data; diff --git a/src/dll/fuse/fuse_intf.c b/src/dll/fuse/fuse_intf.c index a88a66e4..3aac551a 100644 --- a/src/dll/fuse/fuse_intf.c +++ b/src/dll/fuse/fuse_intf.c @@ -429,6 +429,15 @@ static NTSTATUS fsp_fuse_intf_GetFileInfoFunnel(FSP_FILE_SYSTEM *FileSystem, } if (StatEx) FileInfo->FileAttributes |= fsp_fuse_intf_MapFlagsToFileAttributes(stbuf.st_flags); + if (f->dot_hidden) + { + const char *basename = PosixPath; + for (const char *p = PosixPath; '\0' != *p; p++) + if ('/' == *p) + basename = p + 1; + if ('.' == basename[0]) + FileInfo->FileAttributes |= FILE_ATTRIBUTE_HIDDEN; + } FileInfo->FileSize = stbuf.st_size; FileInfo->AllocationSize = (FileInfo->FileSize + AllocationUnit - 1) / AllocationUnit * AllocationUnit; @@ -1712,7 +1721,7 @@ int fsp_fuse_intf_AddDirInfo(void *buf, const char *name, UINT32 Uid, Gid, Mode; NTSTATUS Result0; - Result0 = fsp_fuse_intf_GetFileInfoFunnel(dh->FileSystem, 0, 0, stbuf, + Result0 = fsp_fuse_intf_GetFileInfoFunnel(dh->FileSystem, name, 0, stbuf, &Uid, &Gid, &Mode, 0, &DirInfo->FileInfo); if (NT_SUCCESS(Result0)) DirInfo->Padding[0] = 1; /* HACK: remember that the FileInfo is valid */ diff --git a/src/dll/fuse/library.h b/src/dll/fuse/library.h index fb18d15c..dfbb4e7f 100644 --- a/src/dll/fuse/library.h +++ b/src/dll/fuse/library.h @@ -53,6 +53,7 @@ struct fuse int set_uid, uid; int set_gid, gid; int rellinks; + int dot_hidden; unsigned ThreadCount; struct fuse_operations ops; void *data; @@ -140,7 +141,8 @@ struct fsp_fuse_core_opt_data set_uid, uid, set_gid, gid, set_attr_timeout, attr_timeout, - rellinks; + rellinks, + dot_hidden; int set_FileInfoTimeout, set_DirInfoTimeout, set_EaTimeout, From 3c3163c41b92f57ab00ac5aee7ae37726403c495 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Tue, 16 Apr 2019 12:11:43 -0700 Subject: [PATCH 3/5] dll; fuse: rename dot_hidden option to dothidden --- src/dll/fuse/fuse.c | 8 ++++---- src/dll/fuse/fuse_intf.c | 2 +- src/dll/fuse/library.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dll/fuse/fuse.c b/src/dll/fuse/fuse.c index 55745328..36d048c1 100644 --- a/src/dll/fuse/fuse.c +++ b/src/dll/fuse/fuse.c @@ -71,8 +71,8 @@ static struct fuse_opt fsp_fuse_core_opts[] = FSP_FUSE_CORE_OPT("rellinks", rellinks, 1), FSP_FUSE_CORE_OPT("norellinks", rellinks, 0), - FSP_FUSE_CORE_OPT("dot_hidden", dot_hidden, 1), - FSP_FUSE_CORE_OPT("nodot_hidden", dot_hidden, 0), + FSP_FUSE_CORE_OPT("dothidden", dothidden, 1), + FSP_FUSE_CORE_OPT("nodothidden", dothidden, 0), FUSE_OPT_KEY("fstypename=", 'F'), FUSE_OPT_KEY("volname=", 'v'), @@ -247,7 +247,7 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key, " -o uid=N set file owner (-1 for mounting user id)\n" " -o gid=N set file group (-1 for mounting user group)\n" " -o rellinks interpret absolute symlinks as volume relative\n" - " -o dot_hidden dot files have the Windows hidden file attrib\n" + " -o dothidden dot files have the Windows hidden file attrib\n" " -o volname=NAME set volume label\n" " -o VolumePrefix=UNC set UNC prefix (/Server/Share)\n" " --VolumePrefix=UNC set UNC prefix (\\Server\\Share)\n" @@ -429,7 +429,7 @@ FSP_FUSE_API struct fuse *fsp_fuse_new(struct fsp_fuse_env *env, f->set_uid = opt_data.set_uid; f->uid = opt_data.uid; f->set_gid = opt_data.set_gid; f->gid = opt_data.gid; f->rellinks = opt_data.rellinks; - f->dot_hidden = opt_data.dot_hidden; + f->dothidden = opt_data.dothidden; f->ThreadCount = opt_data.ThreadCount; memcpy(&f->ops, ops, opsize); f->data = data; diff --git a/src/dll/fuse/fuse_intf.c b/src/dll/fuse/fuse_intf.c index 3aac551a..ee3d9b63 100644 --- a/src/dll/fuse/fuse_intf.c +++ b/src/dll/fuse/fuse_intf.c @@ -429,7 +429,7 @@ static NTSTATUS fsp_fuse_intf_GetFileInfoFunnel(FSP_FILE_SYSTEM *FileSystem, } if (StatEx) FileInfo->FileAttributes |= fsp_fuse_intf_MapFlagsToFileAttributes(stbuf.st_flags); - if (f->dot_hidden) + if (f->dothidden) { const char *basename = PosixPath; for (const char *p = PosixPath; '\0' != *p; p++) diff --git a/src/dll/fuse/library.h b/src/dll/fuse/library.h index dfbb4e7f..261d4f8f 100644 --- a/src/dll/fuse/library.h +++ b/src/dll/fuse/library.h @@ -53,7 +53,7 @@ struct fuse int set_uid, uid; int set_gid, gid; int rellinks; - int dot_hidden; + int dothidden; unsigned ThreadCount; struct fuse_operations ops; void *data; @@ -142,7 +142,7 @@ struct fsp_fuse_core_opt_data set_gid, gid, set_attr_timeout, attr_timeout, rellinks, - dot_hidden; + dothidden; int set_FileInfoTimeout, set_DirInfoTimeout, set_EaTimeout, From e9578b48cebc7b769dcc20697b40000c3634838c Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Tue, 16 Apr 2019 12:15:32 -0700 Subject: [PATCH 4/5] update Changelog --- Changelog.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Changelog.asciidoc b/Changelog.asciidoc index 093e3b9f..8c2a4d14 100644 --- a/Changelog.asciidoc +++ b/Changelog.asciidoc @@ -1,6 +1,18 @@ = Changelog +v1.5B2 (2019.3 B2):: + +Changes since v1.4: + +* Extended attribute support has been added for all WinFsp API's: native, .NET, FUSE2 and FUSE3. +* Initial FastIO support has been added. FastIO operations are enabled on cache-enabled file systems with the notable exception of `FastIoQueryOpen`, which allows opening files in kernel mode; this operation requires the file system to specify the `FSP_FSCTL_VOLUME_PARAMS::AllowOpenInKernelMode` flag. +* FUSE has new `-o dothidden` option that is used to add the Windows hidden file attribute to files that start with a dot. +* Fixes for very large (> 4GiB) files. (Thanks @dworkin.) +* A fix for an invalid UID to SID mapping on domains with a lot of users. (Thanks @sganis.) +* A fix on the C++ layer. (Thanks @colatkinson.) + + v1.5B1 (2019.3 B1):: Changes since v1.4: @@ -11,6 +23,7 @@ Changes since v1.4: * A fix for an invalid UID to SID mapping on domains with a lot of users. (Thanks @sganis.) * A fix on the C++ layer. (Thanks @colatkinson.) + v1.4.19049 (2019.2):: Changes since v1.3: From 4f444b412e0be96ca39555c0950c729745b5210a Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Tue, 16 Apr 2019 15:16:54 -0700 Subject: [PATCH 5/5] dll: fuse: create_file_mask, create_dir_mask options --- src/dll/fuse/fuse.c | 8 ++++++++ src/dll/fuse/fuse_intf.c | 18 ++++++++++++++++-- src/dll/fuse/library.h | 4 ++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/dll/fuse/fuse.c b/src/dll/fuse/fuse.c index 36d048c1..3075515a 100644 --- a/src/dll/fuse/fuse.c +++ b/src/dll/fuse/fuse.c @@ -54,6 +54,10 @@ static struct fuse_opt fsp_fuse_core_opts[] = FSP_FUSE_CORE_OPT("umask=%o", umask, 0), FSP_FUSE_CORE_OPT("create_umask=", set_create_umask, 1), FSP_FUSE_CORE_OPT("create_umask=%o", create_umask, 0), + FSP_FUSE_CORE_OPT("create_file_umask=", set_create_file_umask, 1), + FSP_FUSE_CORE_OPT("create_file_umask=%o", create_file_umask, 0), + FSP_FUSE_CORE_OPT("create_dir_umask=", set_create_dir_umask, 1), + FSP_FUSE_CORE_OPT("create_dir_umask=%o", create_dir_umask, 0), FSP_FUSE_CORE_OPT("uid=", set_uid, 1), FSP_FUSE_CORE_OPT("uid=%d", uid, 0), FSP_FUSE_CORE_OPT("gid=", set_gid, 1), @@ -244,6 +248,8 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key, FSP_FUSE_LIBRARY_NAME " options:\n" " -o umask=MASK set file permissions (octal)\n" " -o create_umask=MASK set newly created file permissions (octal)\n" + " -o create_file_umask=MASK for files only\n" + " -o create_dir_umask=MASK for directories only\n" " -o uid=N set file owner (-1 for mounting user id)\n" " -o gid=N set file group (-1 for mounting user group)\n" " -o rellinks interpret absolute symlinks as volume relative\n" @@ -426,6 +432,8 @@ FSP_FUSE_API struct fuse *fsp_fuse_new(struct fsp_fuse_env *env, f->env = env; f->set_umask = opt_data.set_umask; f->umask = opt_data.umask; f->set_create_umask = opt_data.set_create_umask; f->create_umask = opt_data.create_umask; + f->set_create_file_umask = opt_data.set_create_file_umask; f->create_file_umask = opt_data.create_file_umask; + f->set_create_dir_umask = opt_data.set_create_dir_umask; f->create_dir_umask = opt_data.create_dir_umask; f->set_uid = opt_data.set_uid; f->uid = opt_data.uid; f->set_gid = opt_data.set_gid; f->gid = opt_data.gid; f->rellinks = opt_data.rellinks; diff --git a/src/dll/fuse/fuse_intf.c b/src/dll/fuse/fuse_intf.c index ee3d9b63..d9a50424 100644 --- a/src/dll/fuse/fuse_intf.c +++ b/src/dll/fuse/fuse_intf.c @@ -794,8 +794,22 @@ static NTSTATUS fsp_fuse_intf_Create(FSP_FILE_SYSTEM *FileSystem, goto exit; } Mode &= ~context->umask; - if (f->set_create_umask) - Mode = 0777 & ~f->create_umask; + if (CreateOptions & FILE_DIRECTORY_FILE) + { + if (f->set_create_dir_umask) + Mode = 0777 & ~f->create_dir_umask; + else + if (f->set_create_umask) + Mode = 0777 & ~f->create_umask; + } + else + { + if (f->set_create_file_umask) + Mode = 0777 & ~f->create_file_umask; + else + if (f->set_create_umask) + Mode = 0777 & ~f->create_umask; + } memset(&fi, 0, sizeof fi); if ('C' == f->env->environment) /* Cygwin */ diff --git a/src/dll/fuse/library.h b/src/dll/fuse/library.h index 261d4f8f..1cbf4c12 100644 --- a/src/dll/fuse/library.h +++ b/src/dll/fuse/library.h @@ -50,6 +50,8 @@ struct fuse struct fsp_fuse_env *env; int set_umask, umask; int set_create_umask, create_umask; + int set_create_file_umask, create_file_umask; + int set_create_dir_umask, create_dir_umask; int set_uid, uid; int set_gid, gid; int rellinks; @@ -138,6 +140,8 @@ struct fsp_fuse_core_opt_data HANDLE DebugLogHandle; int set_umask, umask, set_create_umask, create_umask, + set_create_file_umask, create_file_umask, + set_create_dir_umask, create_dir_umask, set_uid, uid, set_gid, gid, set_attr_timeout, attr_timeout,