You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Permissions for directories and files created via WSL2 Ubuntu 20.04 should be set by default according to the umask and fmask settings in /etc/wsl.conf.
In the above example, the ls -l command should yield:
$ ls -l
-rw-r--r-- 1 ailiop ailiop 0 Aug 7 13:27 bar
drwxr-xr-x 1 ailiop ailiop 512 Aug 7 13:27 foo
Actual behavior
Directories and files that are created via WSL2 Ubuntu 20.04 in DrvFs-automounted drives always have all permissions set (777 / rwx).
(However, directories and files that are created in the WSL2 Ubuntu 20.04 filesystem, e.g. under ~/, have the expected Linux-default permissions.)
Additional info
This issue does not affect WSL2 Ubuntu 18.04
Surprisingly, if I try the same steps as above (see Steps to reproduce) in WSL2 Ubuntu 18.04, everything works as expected. That is, bar and foo in the example are created with permissions 755 and 744, respectively.
Relevant distribution version: Ubuntu 18.04.5 LTS
Installed WSL2 distributions
PowerShell output:
> wsl --list --all --verbose
NAME STATE VERSION
* Ubuntu-18.04 Running 2
Ubuntu Running 2
Setting umask in ~/.bashrc does not help
I saw #352 and tried setting umask in my ~/.bashrc, but nothing changed. (Plus, that would not explain why things work as expected with WSL2 Ubuntu 18.04.)
The text was updated successfully, but these errors were encountered:
Environment
Steps to reproduce
$ cd /mnt/d $ mkdir foo $ touch bar $ ls -l [...] -rwxrwxrwx 1 ailiop ailiop 0 Aug 7 13:21 bar drwxrwxrwx 1 ailiop ailiop 512 Aug 7 13:21 foo
Expected behavior
Permissions for directories and files created via WSL2 Ubuntu 20.04 should be set by default according to the
umask
andfmask
settings in/etc/wsl.conf
.In the above example, the
ls -l
command should yield:Actual behavior
Directories and files that are created via WSL2 Ubuntu 20.04 in DrvFs-automounted drives always have all permissions set (777 / rwx).
(However, directories and files that are created in the WSL2 Ubuntu 20.04 filesystem, e.g. under
~/
, have the expected Linux-default permissions.)Additional info
This issue does not affect WSL2 Ubuntu 18.04
Surprisingly, if I try the same steps as above (see Steps to reproduce) in WSL2 Ubuntu 18.04, everything works as expected. That is,
bar
andfoo
in the example are created with permissions 755 and 744, respectively.Relevant distribution version:
Ubuntu 18.04.5 LTS
Installed WSL2 distributions
PowerShell output:
Setting
umask
in~/.bashrc
does not helpI saw #352 and tried setting
umask
in my~/.bashrc
, but nothing changed. (Plus, that would not explain why things work as expected with WSL2 Ubuntu 18.04.)The text was updated successfully, but these errors were encountered: