-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bashrc, zshrc: add workaround for umask on WSL
See microsoft/WSL#352.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,17 @@ case $- in | |
*) return;; | ||
esac | ||
|
||
if [ -e /proc/version ] && grep -q Microsoft /proc/version; then | ||
# See https://github.com/microsoft/WSL/issues/352 | ||
if [ "$(umask)" = '000' ]; then | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
yous
Author
Owner
|
||
if [ -e /etc/login.defs ] && grep -q '^[[:space:]]*USERGROUPS_ENAB[[:space:]]\{1,\}yes' /etc/login.defs; then | ||
umask 002 | ||
else | ||
umask 022 | ||
fi | ||
fi | ||
fi | ||
|
||
# don't put duplicate lines or lines starting with space in the history. | ||
# See bash(1) for more options | ||
HISTCONTROL=ignoreboth | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I tried your fix and figured out the check was failing.
umask returned '0000' instead.
Changing that fixed the issue.
Thanks.