$ | >

Making DrvFS fmask=111 usable

(from https://github.com/Microsoft/WSL/issues/3267)

At the moment when using a git repo on DrvFS, all new files will be created as +x, which git detects and sets core.filemode=false. Enabling fmask=111 in drvfs options fixes this, but that breaks all .exe interop, since those need the +x bit too.

As mentioned in the WSL bug, this can be worked around by adding an explicit mount with the options in fstab, but those entries are not auto-mapped when invoking `bash.exe` or `wsl.exe` from windows, meaning either you need to manually mount without fmask any PATH entries and re-write the WSL-side mapped paths, or if you manually mount work directories with fmask, you can't use `wsl.exe` or `bash.exe` from windows straightforwardly any more, since you start in an un-fmasked path by default, meaning you're accidentally committing +x'ed files.

Basically fmask=111 isn't terribly usable right now. There are plenty of options to fix this (several mentioned in the issue), and I have no idea (and don't really care) which is picked, I would guess some would be much simpler for WSL to implement than others.

Probably the most straightforward one from the user side is something like adding drvfs fmask glob override options, e.g:

[automount]
options = "...,fmask=111,fmask:*.exe=000"

which would make all files except those ending in .exe non-executable by default.

6 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Simon Buchan shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base