summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleycec <leycec@gmail.com>2015-07-11 00:52:54 -0400
committerleycec <leycec@gmail.com>2015-07-20 00:56:19 -0400
commitda395c583770b466b5ba83c37d313a7b1c0024c9 (patch)
tree78ab7d6c4321562535e2bc422d27e4c320b63971
parentcb55161470e051e520bad388c20e32d43cfca973 (diff)
downloadzsh-da395c583770b466b5ba83c37d313a7b1c0024c9.tar.gz
zsh-da395c583770b466b5ba83c37d313a7b1c0024c9.tar.bz2
zsh-da395c583770b466b5ba83c37d313a7b1c0024c9.zip
Secure umask enforced during installation.
For safety, a umask of 022 prohibiting both group and other writability is now enforced during OMZ installation. In theory, this should reduce the likelihood of subsequent compinit() failures due to insecure directory permissions under all platforms except for default Cygwin installations (in which Windows ACLs override POSIX umasks).
-rwxr-xr-xtools/install.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/install.sh b/tools/install.sh
index c83a6f23d..405f461e9 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -9,6 +9,13 @@ if [ -d "$ZSH" ]; then
exit
fi
+# Prevent the cloned repository from having insecure permissions. Failing to do
+# so causes compinit() calls to fail with "command not found: compdef" errors
+# for users with insecure umasks (e.g., "002", allowing group writability). Note
+# that this will be ignored under Cygwin by default, as Windows ACLs take
+# precedence over umasks except for filesystems mounted with option "noacl".
+umask g-w,o-w
+
echo "\033[0;34mCloning Oh My Zsh...\033[0m"
hash git >/dev/null 2>&1 && env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
echo "git not installed"