From da092d9a1bcc1f0598a66ab00fd6afa2781e4d45 Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Tue, 29 Sep 2015 07:51:55 +0200 Subject: [PATCH] fix for sudoers.d ownership on HP-UX (VRF 1.3.4) [Patrick Van der Veken] --- manage_sudo.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/manage_sudo.sh b/manage_sudo.sh index 9e8531b..afcc233 100644 --- a/manage_sudo.sh +++ b/manage_sudo.sh @@ -52,6 +52,7 @@ # @(#) 2015-09-15: small fix in wait_for_children() (VRF 1.3.2) [Patrick Van der Veken] # @(#) 2015-09-23: added $GLOBAL_CONFIG_FILE to fix ownership/permissions routine # @(#) (VRF 1.3.3) [Patrick Van der Veken] +# @(#) 2015-09-29: fix for sudoers.d ownership on HP-UX (VRF 1.3.4) [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -65,7 +66,7 @@ # or LOCAL_CONFIG_FILE instead # define the V.R.F (version/release/fix) -MY_VRF="1.3.3" +MY_VRF="1.3.4" # name of the global configuration file (script) GLOBAL_CONFIG_FILE="manage_sudo.conf" # name of the local configuration file (script) @@ -1283,8 +1284,17 @@ case ${ARG_ACTION} in fi if [[ -d "${FIX_DIR}/sudoers.d" ]] then - chmod 755 "${FIX_DIR}/sudoers.d" 2>/dev/null && \ - chown root:sys "${FIX_DIR}/sudoers.d" 2>/dev/null + case ${OS_NAME} in + *HP-UX*) + # sudo >v1.8 + chmod 755 "${FIX_DIR}/sudoers.d" 2>/dev/null && \ + chown bin:bin "${FIX_DIR}/sudoers.d" 2>/dev/null + ;; + *) + chmod 755 "${FIX_DIR}/sudoers.d" 2>/dev/null && \ + chown root:sys "${FIX_DIR}/sudoers.d" 2>/dev/null + ;; + esac fi # checking files (sudoers.d/* are fixed by update_sudo.pl) for FILE in grants alias fragments ${GLOBAL_CONFIG_FILE} update_sudo.conf