Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox can't save a file to the root of a MEMFS mount. #551

Open
dwmega opened this issue Mar 18, 2024 · 3 comments
Open

Firefox can't save a file to the root of a MEMFS mount. #551

dwmega opened this issue Mar 18, 2024 · 3 comments

Comments

@dwmega
Copy link

dwmega commented Mar 18, 2024

Bug Report

Hey there!

I've been working on a WinFSP-based filesystem and found that Firefox was unable to save a file to the root of my mount. After a lot digging through logs, I found myself without any answers so I decided to perform the same test using the MEMFS example filesystem provided with WinFSP.

MEMFS seems to suffer from the same problem: When you try and download any file to the root of a filesystem, Firefox reports a "permissions error" although from the logs, I can't see exactly why.

If you save a file to a subdirectory of the root, everything works expected.

Interestingly, if you create a network mount that's mapped to some drive letter, everything works as expected, too.

I'm not really sure how to proceed with this issue so I figured I'm come to the source :)

Kind regards,
Dave Ward

How to Reproduce

You can reproduce the issue quite easily.

  1. Create an MEMFS mount (make sure it isn't a network mount.)
  2. Go to the WinFSP download page and try and save ChangeLog.md to the mount's root.
  3. This will fail.

For comparison, try the above with a network mount (where the file will download without issues) or in a subdirectory of the mount (which will always work.)

Behaviors

The expected behavior is that we can download a file to the root of a mount.
Actual behavior is that Firefox reports permissions failures.

Environment

Windows 10.0.19045 Build 19045
WinFSP 2023

@billziss-gh
Copy link
Collaborator

I do not have Firefox, but I have the Tor Browser which I believe is based on Firefox. I just created a file system using memfs-x64.exe -m X: and I was able to save a file in its root directory using Tor.

Some questions:

  • Can you post the full command line of how you launch MEMFS?
  • Do you launch it from an non-elevated account or an elevated account (i.e. as Administrator)?
  • Assuming that X: is your mount point what does the command cacls x:\ /s say?

@dwmega
Copy link
Author

dwmega commented Mar 18, 2024

Hey there, @billziss-gh.

Thank you for quick response :)

Assuming memfs is in our path and we're currently in our home:
memfs-x64 -m root

Both Firefox and memfs are launched with standard privileges: No elevation.

The output of cacls is as follows:
C:\Users\k>cacls root /s
C:\Users\k\root "D:(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;S-1-5-21-3900817571-2663857942-4197420431-1001)"

If I mount to a drive letter, the download succeeds.

Output of cacls for a drive-letter mount as follows:
C:\Users\k>cacls z: /s
Z:\ "D:P(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;WD)"

Kind regards,
Dave Ward

@dwmega
Copy link
Author

dwmega commented Mar 18, 2024

Hey @billziss-gh,

If it helps, these are the i?cacls outputs for my filesystem.

In this example, I've created two mounts: One is a "directory-mount" and the other is a "drive-mount."

I can successfully download to the "drive-mount" but not to the "directory-mount"

C:\Users\k\Documents\Projects\sdk\srw-fuse-threaded-refactor\build64>cacls root /s
C:\Users\k\Documents\Projects\sdk\srw-fuse-threaded-refactor\build64\root "D:P(A;;FA;;;S-1-5-21-3900817571-2663857942-4197420431-1001)(A;;0x1200a9;;;WD)"


C:\Users\k\Documents\Projects\sdk\srw-fuse-threaded-refactor\build64>cacls Z: /s
Z:\ "D:P(A;;FA;;;S-1-5-21-3900817571-2663857942-4197420431-1001)(A;;0x1200a9;;;WD)"


C:\Users\k\Documents\Projects\sdk\srw-fuse-threaded-refactor\build64>icacls root
root LYSITHEA\k:(F)
     Everyone:(RX)

Successfully processed 1 files; Failed processing 0 files

C:\Users\k\Documents\Projects\sdk\srw-fuse-threaded-refactor\build64>icacls Z:
Z: LYSITHEA\k:(F)
   Everyone:(RX)

Successfully processed 1 files; Failed processing 0 files

C:\Users\k\Documents\Projects\sdk\srw-fuse-threaded-refactor\build64>

Kind regards,
Dave Ward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants