From f51bdef53427d1bba688fb6c768792fdc22ffc7b Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Wed, 9 Jun 2021 10:17:59 -0700 Subject: [PATCH] dll: fuse: fix path arg to release on Create error When the kernel sends a `Create` message the WinFsp-FUSE layer creates and opens the file (as per Windows semantics). Sometimes an additional operation needs to be performed after the file has been opened, which may fail. In this case the just opened file must be released. In this particular case the WinFsp-FUSE layer used to call `release` with an uninitialized path. This commit fixes the problem. This problem was originally reported in cgofuse (billziss-gh/cgofuse#58) --- src/dll/fuse/fuse_intf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dll/fuse/fuse_intf.c b/src/dll/fuse/fuse_intf.c index 1ab9c056..8ada5f2c 100644 --- a/src/dll/fuse/fuse_intf.c +++ b/src/dll/fuse/fuse_intf.c @@ -951,12 +951,12 @@ exit: if (CreateOptions & FILE_DIRECTORY_FILE) { if (0 != f->ops.releasedir) - f->ops.releasedir(filedesc->PosixPath, &fi); + f->ops.releasedir(contexthdr->PosixPath, &fi); } else { if (0 != f->ops.release) - f->ops.release(filedesc->PosixPath, &fi); + f->ops.release(contexthdr->PosixPath, &fi); } }