From 73abbc02dd32e401cbef0b9dde346733981ac831 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Tue, 17 Jun 2025 10:59:45 +0300 Subject: [PATCH] apache user.crontab access permissions. --- slashRoot/usr/local/lib/comanage_utils.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/slashRoot/usr/local/lib/comanage_utils.sh b/slashRoot/usr/local/lib/comanage_utils.sh index 2a20e52..9cc9757 100644 --- a/slashRoot/usr/local/lib/comanage_utils.sh +++ b/slashRoot/usr/local/lib/comanage_utils.sh @@ -232,13 +232,16 @@ function comanage_utils::deploy_crontab() { crontab="${COMANAGE_REGISTRY_DIR}/local/crontab" fi + chown root:root "${crontab}" + chmod 0644 "${crontab}" + if [[ -n "${COMANAGE_REGISTRY_CRON_USER}" ]]; then cronuser="${COMANAGE_REGISTRY_CRON_USER}" - echo "Removing image default crontab for user www-data ..." > "${OUTPUT}" 2>&1 - /usr/bin/crontab -u www-data -r > "${OUTPUT}" 2>&1 + echo "Removing image default crontab for user apache ..." > "${OUTPUT}" 2>&1 + /usr/bin/crontab -u apache -r > "${OUTPUT}" 2>&1 else - cronuser="www-data" + cronuser="apache" fi if [[ -f "${crontab}" ]]; then @@ -672,7 +675,7 @@ function comanage_utils::prepare_https_cert_key() { if [[ -e '/etc/debian_version' ]]; then cert_path='/etc/apache2/cert.pem' privkey_path='/etc/apache2/privkey.pem' - web_user='www-data' + web_user='apache' elif [[ -e '/etc/centos-release' ]]; then cert_path='/etc/httpd/cert.pem' privkey_path='/etc/httpd/privkey.pem' @@ -1174,7 +1177,7 @@ function comanage_utils::tmp_ownership() { local ownership if [[ -e '/etc/debian_version' ]]; then - ownership='www-data:www-data' + ownership='apache:apache' elif [[ -e '/etc/centos-release' ]]; then ownership='apache:apache' elif [[ -e '/etc/rocky-release' ]]; then