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

Fix umask default for DrvFs automount #2004

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jjvliu
Copy link

@jjvliu jjvliu commented Aug 9, 2024

Fixes #1628 and fixes #1767 so that the docs are consistent with the real behavior of WSL2. From testing, WSL has a default umask of 000, not 022.

Testing done

  1. Create a new file: touch /mnt/c/temp/testfile.
  2. Edit /etc/wsl.conf so that the [automount] section does not contain the key-value pair options = ... and save the file. This ensures the default umask is applied.
  3. Run wsl.exe --shutdown.
  4. Wait 8 seconds.
  5. Open WSL and check the mode of the test file:
$ ls -lh /mnt/c/temp/testfile
-rwxrwxrwx 1 myusername myusername 0 Dec  0 09:33 /mnt/c/temp/testfile

Note that all the permission bits are set, meaning the default umask is 000: anyone can read, write, or execute files.

Copy link
Contributor

Learn Build status updates of commit 0a58727:

✅ Validation status: passed

File Status Preview URL Details
WSL/wsl-config.md ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 259673d:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details

  • [Error: GitBranchDeletedOrForcePushed]
Cannot sync git repo to specified commit because ref +refs/pull/2004/merge has been deleted or has been force pushed.
 If this is pull request, please ensure it is mergeable (no merge conflict) and open (not closed).

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Resolves MicrosoftDocs#1628 by making docs consistent with real behavior tested in WSL2. (Also resolves MicrosoftDocs#1767 by making the table consistent with the following paragraph, but note from testing, it was the paragraph that didn't match the real behavior, not the table.)
@jjvliu jjvliu reopened this Dec 9, 2024
Copy link
Contributor

Learn Build status updates of commit 78aa28a:

✅ Validation status: passed

File Status Preview URL Details
WSL/wsl-config.md ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 78aa28a:

✅ Validation status: passed

File Status Preview URL Details
WSL/wsl-config.md ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@jjvliu
Copy link
Author

jjvliu commented Dec 9, 2024

Hi team, I updated the PR to resolve merge conflicts.

I'd also like to clarify what this is about. From testing, WSL has a default umask of 000, not 022, as mentioned in #1628:

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.

This also fixes a related inconsistency pointed out in #1767 (but by changing the following paragraph, not the table):

The default shown in the table above this was 000. At least one of these must be incorrect.

I added info about testing done to the original post.

Thanks!
Jimmy

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

Successfully merging this pull request may close these issues.

DrvFS default umask umask docs
2 participants