dll: fuse: gracefully handle ENOSYS from xattr calls

This commit is contained in:
Bill Zissimopoulos 2022-05-23 22:07:37 +01:00
parent 61027daf6e
commit f6e6660362
2 changed files with 11 additions and 3 deletions

View File

@ -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;
}

View File

@ -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 ||