mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
dll: fuse: gracefully handle ENOSYS from xattr calls
This commit is contained in:
parent
61027daf6e
commit
f6e6660362
@ -1028,7 +1028,7 @@ static NTSTATUS fsp_fuse_intf_Create(FSP_FILE_SYSTEM *FileSystem,
|
||||
{
|
||||
Result = FspFileSystemEnumerateEa(FileSystem,
|
||||
fsp_fuse_intf_SetEaEntry, contexthdr->PosixPath, ExtraBuffer, ExtraLength);
|
||||
if (!NT_SUCCESS(Result))
|
||||
if (!NT_SUCCESS(Result) && STATUS_INVALID_DEVICE_REQUEST != Result)
|
||||
goto exit;
|
||||
}
|
||||
else
|
||||
@ -1256,7 +1256,7 @@ static NTSTATUS fsp_fuse_intf_Overwrite(FSP_FILE_SYSTEM *FileSystem,
|
||||
|
||||
Result = FspFileSystemEnumerateEa(FileSystem,
|
||||
fsp_fuse_intf_SetEaEntry, filedesc->PosixPath, Ea, EaLength);
|
||||
if (!NT_SUCCESS(Result))
|
||||
if (!NT_SUCCESS(Result) && STATUS_INVALID_DEVICE_REQUEST != Result)
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,15 @@ static NTSTATUS fsp_fuse_loop_start(struct fuse *f)
|
||||
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;
|
||||
{
|
||||
char buf[1024];
|
||||
int err;
|
||||
|
||||
/* if this fails with ENOSYS, then no EA support */
|
||||
err = f->ops.getxattr("/",
|
||||
"non-existant-a11ec902d22f4ec49003af15282d3b00", buf, sizeof buf);
|
||||
f->VolumeParams.ExtendedAttributes = -ENOSYS_(f->env) != err;
|
||||
}
|
||||
|
||||
/* the FSD does not currently limit these VolumeParams fields; do so here! */
|
||||
if (f->VolumeParams.SectorSize < FSP_FUSE_SECTORSIZE_MIN ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user