fix: set correct permissions on sudoers files
RHEL validates 0600, while Debian systems expect 0440.
This commit is contained in:
@@ -24,6 +24,7 @@ trigger-nginx-vhosts-install() {
|
||||
NGINX_SUDOERS_FILE="/etc/sudoers.d/dokku-openresty"
|
||||
fi
|
||||
|
||||
local mode="0440"
|
||||
case "$DOKKU_DISTRO" in
|
||||
debian | raspbian)
|
||||
echo "%dokku ALL=(ALL) NOPASSWD:/usr/sbin/invoke-rc.d $NGINX_INIT_NAME reload, $NGINX_BIN -t, ${NGINX_BIN} -t -c *" >"$NGINX_SUDOERS_FILE"
|
||||
@@ -48,10 +49,11 @@ trigger-nginx-vhosts-install() {
|
||||
centos | fedora | rhel)
|
||||
echo "%dokku ALL=(ALL) NOPASSWD:/usr/bin/systemctl reload $NGINX_INIT_NAME, $NGINX_BIN -t, $NGINX_BIN -t -c *" >"$NGINX_SUDOERS_FILE"
|
||||
echo "Defaults:dokku !requiretty" >>"$NGINX_SUDOERS_FILE"
|
||||
mode="0600"
|
||||
;;
|
||||
esac
|
||||
|
||||
chmod 0440 "$NGINX_SUDOERS_FILE"
|
||||
chmod "$mode" "$NGINX_SUDOERS_FILE"
|
||||
|
||||
# if dhparam.pem has not been created, create it the first time
|
||||
if [[ ! -f "$NGINX_ROOT/dhparam.pem" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user