Skip to content

Commit

Permalink
Fix umask default for DrvFs automount
Browse files Browse the repository at this point in the history
Properly fixes #1767 in a way that is consistent with the real behavior of WSL2. Although 8c167d6 removes inconsistency between the automount table and the paragraph on line 93, it does not match the real behavior of WSL2: I observed by experimenting with /etc/wsl.conf that no umask is applied by default.
  • Loading branch information
jjvliu authored Aug 9, 2024
1 parent b6dc675 commit 0a58727
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions WSL/wsl-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ Setting different mount options for Windows drives (DrvFs) can control how file
|:----|:----|:----|
|uid| The User ID used for the owner of all files | The default User ID of your WSL distro (on first installation this defaults to 1000)
|gid| The Group ID used for the owner of all files | The default group ID of your WSL distro (on first installation this defaults to 1000)
|umask | An octal mask of permissions to exclude for all files and directories | 022
|umask | An octal mask of permissions to exclude for all files and directories | 000
|fmask | An octal mask of permissions to exclude for all files | 000
|dmask | An octal mask of permissions to exclude for all directories | 000
|metadata | Whether metadata is added to Windows files to support Linux system permissions | disabled
|case | Determines directories treated as case sensitive and whether new directories created with WSL will have the flag set. See [case sensitivity](./case-sensitivity.md) for a detailed explanation of the options. Options include `off`, `dir`, or `force`. | `off`

By default, WSL sets the uid and gid to the value of the default user. For example, in Ubuntu, the default user is uid=1000, gid=1000. If this value is used to specify a different gid or uid option, the default user value will be overwritten. Otherwise, the default value will always be appended.

User file-creation mode mask (umask) sets permission for newly created files. The default is 022, only you can write data but anyone can read data. Values can be changed to reflect different permission settings. For example, `umask=077` changes permission to be completely private, no other user can read or write data. To further specify permission, fmask (files) and dmask (directories) can also be used.
User file-creation mode mask (umask) sets permission for newly created files. The default is 000, meaning anyone can read, write, or execute files. Values can be changed to reflect different permission settings. For example, `umask=077` changes permission to be completely private, no other user can read or write data. To further specify permission, fmask (files) and dmask (directories) can also be used.

> [!NOTE]
> The permission masks are put through a logical OR operation before being applied to files or directories.
Expand Down

0 comments on commit 0a58727

Please sign in to comment.