mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
sys,dll: symbolic link (reparse point) support: WIP
This commit is contained in:
parent
ab278d7b60
commit
7337f3c6cd
@ -118,6 +118,8 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\..\src\dll\fuse\fuse.pc" />
|
||||
<CustomBuild Include="..\..\src\dll\fuse\fuse.pc">
|
||||
<Filter>Source\fuse</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -125,8 +125,8 @@ typedef struct
|
||||
UINT32 UnicodeOnDisk:1; /* file system supports Unicode in file names */
|
||||
UINT32 PersistentAcls:1; /* file system preserves and enforces access control lists */
|
||||
UINT32 ReparsePoints:1; /* file system supports reparse points */
|
||||
UINT32 ReparsePointPrivilegeCheck:1;/* file system perform reparse point privilege checks */
|
||||
UINT32 SymbolicLinksOnly:1; /* file system supports only symbolic link reparse points */
|
||||
UINT32 ReparsePointsPrivilegeCheck:1; /* file system performs reparse point privilege checks */
|
||||
UINT32 ReparsePointsSymbolicLinks:1; /* file system supports only symbolic link reparse points */
|
||||
UINT32 NamedStreams:1; /* file system supports named streams (!!!: unimplemented) */
|
||||
UINT32 HardLinks:1; /* unimplemented; set to 0 */
|
||||
UINT32 ExtendedAttributes:1; /* unimplemented; set to 0 */
|
||||
|
@ -752,6 +752,7 @@ typedef struct _FSP_FILE_SYSTEM
|
||||
UINT32 DebugLog;
|
||||
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY OpGuardStrategy;
|
||||
SRWLOCK OpGuardLock;
|
||||
UINT32 ReparsePointsSymbolicLinks:1;
|
||||
} FSP_FILE_SYSTEM;
|
||||
/**
|
||||
* Create a file system object.
|
||||
|
@ -106,6 +106,8 @@ FSP_API NTSTATUS FspFileSystemCreate(PWSTR DevicePath,
|
||||
FileSystem->EnterOperation = FspFileSystemOpEnter;
|
||||
FileSystem->LeaveOperation = FspFileSystemOpLeave;
|
||||
|
||||
FileSystem->ReparsePointsSymbolicLinks = VolumeParams->ReparsePointsSymbolicLinks;
|
||||
|
||||
*PFileSystem = FileSystem;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -906,7 +906,7 @@ FSP_API NTSTATUS FspFileSystemOpFileSystemControl(FSP_FILE_SYSTEM *FileSystem,
|
||||
SymlinkReparseData = (PREPARSE_DATA_BUFFER)Response->Buffer;
|
||||
memset(SymlinkReparseData, 0, sizeof *SymlinkReparseData);
|
||||
|
||||
if (1/*!!!: SymbolicLinksOnly*/)
|
||||
if (FileSystem->ReparsePointsSymbolicLinks)
|
||||
{
|
||||
Size = FSP_FSCTL_TRANSACT_RSP_SIZEMAX - FIELD_OFFSET(FSP_FSCTL_TRANSACT_RSP, Buffer) -
|
||||
sizeof(*SymlinkReparseData);
|
||||
@ -968,7 +968,7 @@ FSP_API NTSTATUS FspFileSystemOpFileSystemControl(FSP_FILE_SYSTEM *FileSystem,
|
||||
SymlinkReparseData = (PREPARSE_DATA_BUFFER)
|
||||
(Request->Buffer + Request->Req.FileSystemControl.Buffer.Offset);
|
||||
|
||||
if (1/*!!!: SymbolicLinksOnly*/)
|
||||
if (FileSystem->ReparsePointsSymbolicLinks)
|
||||
{
|
||||
Result = FileSystem->Interface->SetReparsePoint(FileSystem, Request,
|
||||
(PVOID)Request->Req.FileSystemControl.UserContext,
|
||||
|
@ -449,7 +449,7 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key,
|
||||
" -o VolumeSerialNumber=N 32-bit wide\n"
|
||||
" -o FileInfoTimeout=N FileInfo/Security/VolumeInfo timeout (millisec)\n"
|
||||
" -o CaseInsensitiveSearch file system supports case-insensitive file names\n"
|
||||
//" -o ReparsePoints file system supports reparse points\n"
|
||||
" -o ReparsePoints file system supports reparse points\n"
|
||||
//" -o NamedStreams file system supports named streams\n"
|
||||
//" -o ReadOnlyVolume file system is read only\n"
|
||||
" --UNC=U --VolumePrefix=U UNC prefix (\\Server\\Share)\n");
|
||||
|
@ -126,7 +126,7 @@ static NTSTATUS FspFsvolFileSystemControlReparsePoint(
|
||||
ReparseTag = ((PREPARSE_DATA_BUFFER)InputBuffer)->ReparseTag;
|
||||
|
||||
/* NTFS severely limits symbolic links; we will not do that unless our file system asks */
|
||||
if (FsvolDeviceExtension->VolumeParams.ReparsePointPrivilegeCheck)
|
||||
if (FsvolDeviceExtension->VolumeParams.ReparsePointsPrivilegeCheck)
|
||||
{
|
||||
if (IO_REPARSE_TAG_SYMLINK == ReparseTag &&
|
||||
KernelMode != Irp->RequestorMode &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user