From 905497da1838e5d7b35d6a0daf6c241c47d59323 Mon Sep 17 00:00:00 2001 From: zhangnaru0605 <67086371+zhangnaru0605@users.noreply.github.com> Date: Tue, 14 Jul 2020 21:43:15 +0800 Subject: Maintain permisision to set umask set umask in case resolv.conf doesn't exist --- network-scripts/network-functions | 3 +++ 1 file changed, 3 insertions(+) (limited to 'network-scripts') diff --git a/network-scripts/network-functions b/network-scripts/network-functions index 99096bd8..332115b8 100644 --- a/network-scripts/network-functions +++ b/network-scripts/network-functions @@ -622,6 +622,8 @@ is_bonding_device () # Invoke this when /etc/resolv.conf has changed: change_resolv_conf () { + oldumask=$(umask) + umask 022 s=$(/bin/grep '^[\ \ ]*option' /etc/resolv.conf 2>/dev/null) if [ $# -gt 1 ]; then if [ "x$s" != "x" ]; then @@ -657,6 +659,7 @@ change_resolv_conf () /usr/bin/logger -p local7.notice -t "NET" -i "$0 : updated /etc/resolv.conf" [ -e /run/nscd/socket ] && /usr/sbin/nscd -i hosts # invalidate cache fi + umask "$oldumask" return $r } -- cgit v1.2.1