mirror of
https://github.com/winfsp/winfsp.git
synced 2025-07-03 09:22:57 -05:00
inc, src: PostDispositionWhenNecessaryOnly
- Rename PostDispositionForDirOnly to PostDispositionWhenNecessaryOnly - Implement PostDispositionWhenNecessaryOnly across the board
This commit is contained in:
@ -1142,7 +1142,8 @@ FSP_API NTSTATUS FspFileSystemOpSetInformation(FSP_FILE_SYSTEM *FileSystem,
|
||||
break;
|
||||
case 13/*FileDispositionInformation*/:
|
||||
case 64/*FileDispositionInformationEx*/:
|
||||
if (0 == (0x10/*IGNORE_READONLY_ATTRIBUTE*/ & Request->Req.SetInformation.Info.DispositionEx.Flags) &&
|
||||
if (1/*DELETE*/ == (0x11/*DELETE|IGNORE_READONLY_ATTRIBUTE*/ &
|
||||
Request->Req.SetInformation.Info.DispositionEx.Flags) &&
|
||||
0 != FileSystem->Interface->GetFileInfo)
|
||||
{
|
||||
Result = FileSystem->Interface->GetFileInfo(FileSystem,
|
||||
|
@ -184,6 +184,8 @@ static NTSTATUS fsp_fuse_loop_start(struct fuse *f)
|
||||
f->has_slashdot = 0 == err && 0040000 == (stbuf.st_mode & 0170000);
|
||||
}
|
||||
}
|
||||
if (0 == (f->conn_want & FSP_FUSE_CAP_DELETE_ACCESS) || 0 == f->ops.access)
|
||||
f->VolumeParams.PostDispositionWhenNecessaryOnly = 1;
|
||||
if (0 != f->ops.listxattr && 0 != f->ops.getxattr &&
|
||||
0 != f->ops.setxattr && 0 != f->ops.removexattr)
|
||||
f->VolumeParams.ExtendedAttributes = 1;
|
||||
|
@ -277,6 +277,11 @@ namespace Fsp
|
||||
get { return 0 != (_VolumeParams.Flags & VolumeParams.PostCleanupWhenModifiedOnly); }
|
||||
set { _VolumeParams.Flags |= (value ? VolumeParams.PostCleanupWhenModifiedOnly : 0); }
|
||||
}
|
||||
public Boolean PostDispositionWhenNecessaryOnly
|
||||
{
|
||||
get { return 0 != (_VolumeParams.Flags & VolumeParams.PostDispositionWhenNecessaryOnly); }
|
||||
set { _VolumeParams.Flags |= (value ? VolumeParams.PostDispositionWhenNecessaryOnly : 0); }
|
||||
}
|
||||
public Boolean PassQueryDirectoryPattern
|
||||
{
|
||||
get { return 0 != (_VolumeParams.Flags & VolumeParams.PassQueryDirectoryPattern); }
|
||||
|
@ -56,6 +56,7 @@ namespace Fsp.Interop
|
||||
internal const UInt32 WslFeatures = 0x04000000;
|
||||
internal const UInt32 RejectIrpPriorToTransact0 = 0x10000000;
|
||||
internal const UInt32 SupportsPosixUnlinkRename = 0x20000000;
|
||||
internal const UInt32 PostDispositionWhenNecessaryOnly = 0x40000000;
|
||||
internal const int PrefixSize = 192;
|
||||
internal const int FileSystemNameSize = 16;
|
||||
|
||||
|
@ -1607,7 +1607,7 @@ retry:
|
||||
}
|
||||
FileDesc->DispositionStatus = STATUS_SUCCESS;
|
||||
|
||||
if (!FileNode->IsDirectory && FsvolDeviceExtension->VolumeParams.PostDispositionForDirOnly)
|
||||
if (!FileNode->IsDirectory && FsvolDeviceExtension->VolumeParams.PostDispositionWhenNecessaryOnly)
|
||||
{
|
||||
if (FILE_DISPOSITION_DELETE ==
|
||||
(DispositionFlags & (FILE_DISPOSITION_DELETE | FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE)))
|
||||
@ -1615,7 +1615,6 @@ retry:
|
||||
FSP_FSCTL_FILE_INFO FileInfoBuf;
|
||||
if (!FspFileNodeTryGetFileInfo(FileNode, &FileInfoBuf))
|
||||
goto slow;
|
||||
|
||||
if (0 != (FileInfoBuf.FileAttributes & FILE_ATTRIBUTE_READONLY))
|
||||
{
|
||||
Result = STATUS_CANNOT_DELETE;
|
||||
@ -1627,8 +1626,8 @@ retry:
|
||||
|
||||
Result = STATUS_SUCCESS;
|
||||
goto unlock_exit;
|
||||
}
|
||||
slow:;
|
||||
}
|
||||
|
||||
Result = FspIopCreateRequestEx(Irp, &FileNode->FileName, 0,
|
||||
FspFsvolSetInformationRequestFini, &Request);
|
||||
|
Reference in New Issue
Block a user