From: Michael Prokop Date: Sun, 19 Jun 2011 09:59:39 +0000 (+0200) Subject: Disable specific umask settings by default. X-Git-Tag: v0.4.00~32 X-Git-Url: https://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=cbbf17b3f869d4c25ca45f48ca5ee336687cafd8 Disable specific umask settings by default. Recently this turned up into quite a lot of discussion. /etc/login.defs provides the system wide configuration which we shouldn't ignore and override. So move our umask settings from /etc/zsh/zshrc to /etc/skel/.zshrc and provide it as comments (so disabled by default). --- diff --git a/doc/grmlzshrc.t2t b/doc/grmlzshrc.t2t index 621a384..1d810ab 100644 --- a/doc/grmlzshrc.t2t +++ b/doc/grmlzshrc.t2t @@ -26,10 +26,7 @@ features are enabled in every version). //grmlzshrc// behaves differently depending on which user loads it. For the root user (**EUID** == 0) only a subset of features is loaded by default. This behaviour can be altered by setting the **GRML_ALWAYS_LOAD_ALL** STARTUP -VARIABLE (see below). Also the umask(1) for the root user is set to 022, -while for regular users it is set to 002. So read/write permissions -for the regular user and her group are set for new files (keep that -in mind on systems, where regular users share a common group). +VARIABLE (see below). = STARTUP VARIABLES = Some of the behaviour of //grmlzshrc// can be altered by setting certain shell diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index dd4b14d..9837a97 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -30,6 +30,13 @@ if [ -r ~/.zshrc -a -r ~/.zshrc.global -a ! -r ~/.zshrc.local ] ; then printf '-!-\n' fi +## Settings for umask +#if (( EUID == 0 )); then +# umask 002 +#else +# umask 022 +#fi + ## Now, we'll give a few examples of what you might want to use in your ## .zshrc.local file (just copy'n'paste and uncomment it there): diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 8455094..c1b4955 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -256,17 +256,6 @@ zrcautoload is-at-least || is-at-least() { return 1 } # }}} # {{{ set some important options (as early as possible) -# Please update these tags, if you change the umask settings below. -#o# r_umask 002 -#o# r_umaskstr rwxrwxr-x -#o# umask 022 -#o# umaskstr rwxr-xr-x -if (( EUID == 0 )); then - umask 002 -else - umask 022 -fi - setopt append_history # append history list to the history file (important for multiple parallel zsh sessions!) is4 && setopt SHARE_HISTORY # import new commands from the history file also in other zsh-session setopt extended_history # save each command's beginning timestamp and the duration to the history file