Pkg.jl icon indicating copy to clipboard operation
Pkg.jl copied to clipboard

Use WSL style NTFS extended attributes to store permissions of extracted artifacts on Windows

Open davidanthoff opened this issue 3 years ago • 1 comments

The idea would be to follow https://docs.microsoft.com/en-us/windows/wsl/file-permissions#wsl-metadata-on-windows-files to store unix file permissions instead of changing ACLs of extracted files on Windows. The functions to interact with these extended attributes are https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-zwqueryeafile and https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-zwseteafile.

@staticfloat, @StefanKarpinski, giordano had a brief chat about this on Slack, and I'm just opening this issue to keep a record of the links we dug out.

davidanthoff avatar Jul 26 '21 23:07 davidanthoff

Okay, had a talk with @vtjnash about this, and we're on board with trying this out.

The concrete steps forward are:

  • [ ] Write the EA utility functions in libuv to read/write WSL2 permissions strings, use those in uv_fs__chmod() and uv_fs__stat() instead of the ACL code.
  • [ ] Create Julia branch that uses that libuv code, so chmod() and stat() use EAs instead of ACLs
  • [ ] See if our access(X_OK) code can detect whether ~/.julia inherits an executable permission, and if it does not, surface a warning to the user that they may need to do something like icacls .julia /grant ${USER}:(OI)(CI)F /T.

staticfloat avatar Jul 27 '21 16:07 staticfloat