Skip to content

Commit

Permalink
apache user.crontab access permissions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Jun 17, 2025
1 parent aeedef3 commit 73abbc0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions slashRoot/usr/local/lib/comanage_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 73abbc0

Please sign in to comment.