MicrosoftDocs / WSL

Source code behind the Windows Subsystem for Linux documentation.
https://docs.microsoft.com/windows/wsl
Other
1.92k stars 576 forks source link

DrvFS default umask #1628

Open KoltesDigital opened 2 years ago

KoltesDigital commented 2 years ago

Documentation Issue

In the table, default umask is said to be 000. In the text afterwards, it's said to be 022. From my experience, almost all files and directories from DrvFS are 777, so it seems the former is correct.

Besides, it's written that permissions go through an OR, however it's a AND(NOT).

Link to documentation page

https://learn.microsoft.com/en-us/windows/wsl/wsl-config

Suggested Improvements

No response

jjvliu commented 3 months ago

Same issue as #1767 (technically, that one is the duplicate since this came earlier). Addressed by #2004.

Regarding this part:

it's written that permissions go through an OR, however it's a AND(NOT).

The documentation is correct as written:

The permission masks are put through a logical OR operation before being applied to files or directories.

The masks umask, fmask, and dmask are put through a logical OR. For example, if umask=123,fmask=321,dmask=000, then the final mask actually applied to files is 444 and to directories is 123, so the default permissions for files will be 333 and for directories will be 654.