From 15aeeb4d3be09089a851c7a8a49dfe6093c2dc0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Mon, 18 Sep 2023 17:36:47 -1000 Subject: [PATCH] Allow opensearch-dashboard user to read its config (#4038) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Romain Tartière Signed-off-by: Peter Zhu --- .../build_templates/opensearch-dashboards/deb/debian/postinst | 1 + .../opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/pkg/build_templates/opensearch-dashboards/deb/debian/postinst b/scripts/pkg/build_templates/opensearch-dashboards/deb/debian/postinst index e2ee3f3fa4..294f284582 100755 --- a/scripts/pkg/build_templates/opensearch-dashboards/deb/debian/postinst +++ b/scripts/pkg/build_templates/opensearch-dashboards/deb/debian/postinst @@ -41,6 +41,7 @@ echo " If you are configuring tools that require read access to the OpenSearch D echo " For more information, see https://github.com/opensearch-project/opensearch-build/pull/4043" # Set ownership and permissions +chown -R root.opensearch-dashboards ${config_dir} chmod -R u=rwX,g=rX,o= ${config_dir} chown -R opensearch-dashboards.adm ${log_dir} diff --git a/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec b/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec index e7752cb4b5..417e4c95dc 100644 --- a/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec +++ b/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec @@ -83,6 +83,7 @@ exit 0 %post set -e +chown -R root.%{name} %{config_dir} # Reload systemctl daemon if command -v systemctl > /dev/null; then systemctl daemon-reload