diff options
Diffstat (limited to 'src/lib/globals')
-rw-r--r-- | src/lib/globals | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lib/globals b/src/lib/globals index cf99575..42ac177 100644 --- a/src/lib/globals +++ b/src/lib/globals @@ -4,8 +4,6 @@ SUBR_DIR="/usr/lib/network" STATE_DIR="/run/network" STATE_FILE="${NETCTL_STATE_FILE:-/var/lib/netctl/netctl.state}" -umask 077 - ### Logging/Error reporting @@ -72,6 +70,16 @@ do_debug() { "$@" } +## Evaluate with a permissive umask +do_readable() { + local result + umask 022 + "$@" + result=$? + umask 077 + return $result +} + ## Exit if we are not effectively root # $1: program name (optional) ensure_root() { @@ -126,4 +134,8 @@ load_profile() { } +# Set a restrictive umask +do_readable : + + # vim: ft=sh ts=4 et sw=4: |