Unverified Commit 4773246b authored by Luiz Costa's avatar Luiz Costa Committed by GitHub
Browse files

Fix permissions (#11146)


Co-authored-by: default avatarLuiz Costa <me@luizgustavo.pro.br>
parent 6545958b
...@@ -5,9 +5,7 @@ if [ "$1" = "configure" ] ; then ...@@ -5,9 +5,7 @@ if [ "$1" = "configure" ] ; then
# User will have a shell. Not secure but require refactoring otherwise. # User will have a shell. Not secure but require refactoring otherwise.
adduser --system --group --shell /bin/bash --home /var/lib/centreon centreon adduser --system --group --shell /bin/bash --home /var/lib/centreon centreon
fi fi
if [ "$(getent passwd www-data)" ]; then
usermod -a -G centreon www-data
fi
chown -vR centreon:centreon \ chown -vR centreon:centreon \
/etc/centreon \ /etc/centreon \
/var/cache/centreon /var/cache/centreon
......
...@@ -34,5 +34,17 @@ view centreon included .1.3.6.1" \ ...@@ -34,5 +34,17 @@ view centreon included .1.3.6.1" \
access notConfigGroup \"\" any noauth exact centreon none none" \ access notConfigGroup \"\" any noauth exact centreon none none" \
/etc/snmp/snmpd.conf /etc/snmp/snmpd.conf
fi fi
# Fix centreon configuration permissions
chmod -v 0775 /etc/centreon
chmod -v 0664 \
/etc/centreon/centreon.conf.php \
/etc/centreon/centreontrapd.pm \
/etc/centreon/config.yaml \
/etc/centreon/conf.pm
chown -v centreon:centreon \
/etc/centreon/centreontrapd.pm \
/etc/centreon/conf.pm
fi fi
exit 0 exit 0
...@@ -15,6 +15,11 @@ if [ "$1" = "configure" ] ; then ...@@ -15,6 +15,11 @@ if [ "$1" = "configure" ] ; then
systemctl restart apache2 php8.0-fpm systemctl restart apache2 php8.0-fpm
fi fi
if [ "$(getent passwd www-data)" ]; then
usermod -a -G centreon www-data
usermod -a -G www-data centreon
fi
fi fi
exit 0 exit 0
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
if [ "$1" = "configure" ] ; then if [ "$1" = "configure" ] ; then
if [ "$(getent passwd www-data)" ]; then
usermod -a -G www-data centreon
fi
if [ "$(getent passwd centreon)" ]; then if [ "$(getent passwd centreon)" ]; then
chown -R centreon:centreon /usr/share/centreon chown -R centreon:centreon /usr/share/centreon
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment