From 8d4574c7ca3c437a931b687e1cc182ff4a2fc85c Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 17 Nov 2023 09:43:09 +0100 Subject: [PATCH] Added permissions change for merged.mg files in upgrade --- debs/SPECS/wazuh-manager/debian/postinst | 2 ++ rpms/SPECS/wazuh-manager.spec | 3 +++ 2 files changed, 5 insertions(+) diff --git a/debs/SPECS/wazuh-manager/debian/postinst b/debs/SPECS/wazuh-manager/debian/postinst index 16935a565d..ece01e5b0f 100644 --- a/debs/SPECS/wazuh-manager/debian/postinst +++ b/debs/SPECS/wazuh-manager/debian/postinst @@ -170,6 +170,8 @@ case "$1" in chmod 0660 ${DIR}/logs/active-responses.log chmod 0640 ${DIR}/logs/integrations.log + # Set merged.mg permissions to new ones + find ${DIR}/etc/shared/ -type f -name 'merged.mg' -exec chmod 644 {} \; if [ -f ${DIR}/etc/shared/ar.conf ]; then chown root:wazuh ${DIR}/etc/shared/ar.conf diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 53f1bca207..173e40b65f 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -330,6 +330,9 @@ fi rm -f %{_localstatedir}/etc/shared/ar.conf >/dev/null 2>&1 rm -f %{_localstatedir}/etc/shared/merged.mg >/dev/null 2>&1 +# Set merged.mg permissions to new ones +find %{_localstatedir}/etc/shared/ -type f -name 'merged.mg' -exec chmod 644 {} \; + # CentOS if [ -r "/etc/centos-release" ]; then DIST_NAME="centos"