From 181a571b88f3d50e8d452cf90e4d19b605e6525e Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 15 Apr 2024 18:26:10 +0000 Subject: [PATCH] Update . to : for all chown coomands in deb/rpm build templates Signed-off-by: Peter Zhu --- .../current/opensearch-dashboards/deb/debian/postinst | 8 ++++---- .../rpm/opensearch-dashboards.rpm.spec | 2 +- .../current/opensearch/deb/debian/postinst | 8 ++++---- .../current/opensearch/rpm/opensearch.rpm.spec | 4 ++-- .../legacy/opensearch-dashboards/deb/debian/postinst | 10 +++++----- .../legacy/opensearch/deb/debian/postinst | 10 +++++----- .../legacy/opensearch/rpm/opensearch.rpm.spec | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/pkg/build_templates/current/opensearch-dashboards/deb/debian/postinst b/scripts/pkg/build_templates/current/opensearch-dashboards/deb/debian/postinst index fabe746d2f..8c37ed0c77 100755 --- a/scripts/pkg/build_templates/current/opensearch-dashboards/deb/debian/postinst +++ b/scripts/pkg/build_templates/current/opensearch-dashboards/deb/debian/postinst @@ -50,16 +50,16 @@ 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} +chown -R root:opensearch-dashboards ${config_dir} chmod -R u=rwX,g=rX,o= ${config_dir} -chown -R opensearch-dashboards.adm ${log_dir} +chown -R opensearch-dashboards:adm ${log_dir} chmod 750 ${log_dir} -chown -R opensearch-dashboards.opensearch-dashboards ${data_dir} +chown -R opensearch-dashboards:opensearch-dashboards ${data_dir} chmod 750 ${data_dir} -chown -R opensearch-dashboards.opensearch-dashboards ${pid_dir} +chown -R opensearch-dashboards:opensearch-dashboards ${pid_dir} exit 0 diff --git a/scripts/pkg/build_templates/current/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec b/scripts/pkg/build_templates/current/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec index 4f8bf687c0..43c050185c 100644 --- a/scripts/pkg/build_templates/current/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec +++ b/scripts/pkg/build_templates/current/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec @@ -83,7 +83,7 @@ exit 0 %post set -e -chown -R root.%{name} %{config_dir} +chown -R root:%{name} %{config_dir} # Reload systemctl daemon if command -v systemctl > /dev/null; then systemctl daemon-reload diff --git a/scripts/pkg/build_templates/current/opensearch/deb/debian/postinst b/scripts/pkg/build_templates/current/opensearch/deb/debian/postinst index 2cec14f4f8..d3e0d99ba5 100755 --- a/scripts/pkg/build_templates/current/opensearch/deb/debian/postinst +++ b/scripts/pkg/build_templates/current/opensearch/deb/debian/postinst @@ -38,16 +38,16 @@ fi # Set ownership and permissions # FIXME: the opensearch service should not have w permission in the config directory -chown -R opensearch.opensearch ${config_dir} +chown -R opensearch:opensearch ${config_dir} chmod -R u=rwX,g=rX,o= ${config_dir} -chown -R opensearch.adm ${log_dir} +chown -R opensearch:adm ${log_dir} chmod 750 ${log_dir} -chown -R opensearch.opensearch ${data_dir} +chown -R opensearch:opensearch ${data_dir} chmod 750 ${data_dir} -chown -R opensearch.opensearch ${pid_dir} +chown -R opensearch:opensearch ${pid_dir} # Reload systemctl daemon if command -v systemctl > /dev/null; then diff --git a/scripts/pkg/build_templates/current/opensearch/rpm/opensearch.rpm.spec b/scripts/pkg/build_templates/current/opensearch/rpm/opensearch.rpm.spec index 37b0a53e90..d96e9245af 100644 --- a/scripts/pkg/build_templates/current/opensearch/rpm/opensearch.rpm.spec +++ b/scripts/pkg/build_templates/current/opensearch/rpm/opensearch.rpm.spec @@ -103,8 +103,8 @@ set -e if [ -d %{product_dir}/plugins/opensearch-security ]; then sh %{product_dir}/plugins/opensearch-security/tools/install_demo_configuration.sh -y -i -s > %{log_dir}/install_demo_configuration.log 2>&1 || (echo "ERROR: Something went wrong during demo configuration installation. Please see the logs in %{log_dir}/install_demo_configuration.log" && exit 1) fi -chown -R %{name}.%{name} %{config_dir} -chown -R %{name}.%{name} %{log_dir} +chown -R %{name}:%{name} %{config_dir} +chown -R %{name}:%{name} %{log_dir} # Apply PerformanceAnalyzer Settings chmod a+rw /tmp if ! grep -q '## OpenSearch Performance Analyzer' %{config_dir}/jvm.options; then diff --git a/scripts/pkg/build_templates/legacy/opensearch-dashboards/deb/debian/postinst b/scripts/pkg/build_templates/legacy/opensearch-dashboards/deb/debian/postinst index 6f3034cbd4..5f49dbfff5 100755 --- a/scripts/pkg/build_templates/legacy/opensearch-dashboards/deb/debian/postinst +++ b/scripts/pkg/build_templates/legacy/opensearch-dashboards/deb/debian/postinst @@ -41,11 +41,11 @@ 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 owner -chown -R opensearch-dashboards.opensearch-dashboards ${product_dir} -chown -R opensearch-dashboards.opensearch-dashboards ${config_dir} -chown -R opensearch-dashboards.opensearch-dashboards ${log_dir} -chown -R opensearch-dashboards.opensearch-dashboards ${data_dir} -chown -R opensearch-dashboards.opensearch-dashboards ${pid_dir} +chown -R opensearch-dashboards:opensearch-dashboards ${product_dir} +chown -R opensearch-dashboards:opensearch-dashboards ${config_dir} +chown -R opensearch-dashboards:opensearch-dashboards ${log_dir} +chown -R opensearch-dashboards:opensearch-dashboards ${data_dir} +chown -R opensearch-dashboards:opensearch-dashboards ${pid_dir} exit 0 diff --git a/scripts/pkg/build_templates/legacy/opensearch/deb/debian/postinst b/scripts/pkg/build_templates/legacy/opensearch/deb/debian/postinst index 515a0e5419..af5c914346 100755 --- a/scripts/pkg/build_templates/legacy/opensearch/deb/debian/postinst +++ b/scripts/pkg/build_templates/legacy/opensearch/deb/debian/postinst @@ -38,11 +38,11 @@ if ! grep -q '## OpenSearch Performance Analyzer' ${config_dir}/jvm.options; the fi # Set owner -chown -R opensearch.opensearch ${product_dir} -chown -R opensearch.opensearch ${config_dir} -chown -R opensearch.opensearch ${log_dir} -chown -R opensearch.opensearch ${data_dir} -chown -R opensearch.opensearch ${pid_dir} +chown -R opensearch:opensearch ${product_dir} +chown -R opensearch:opensearch ${config_dir} +chown -R opensearch:opensearch ${log_dir} +chown -R opensearch:opensearch ${data_dir} +chown -R opensearch:opensearch ${pid_dir} # Reload systemctl daemon if command -v systemctl > /dev/null; then diff --git a/scripts/pkg/build_templates/legacy/opensearch/rpm/opensearch.rpm.spec b/scripts/pkg/build_templates/legacy/opensearch/rpm/opensearch.rpm.spec index 6d9eec3bab..1fa50684ba 100644 --- a/scripts/pkg/build_templates/legacy/opensearch/rpm/opensearch.rpm.spec +++ b/scripts/pkg/build_templates/legacy/opensearch/rpm/opensearch.rpm.spec @@ -102,8 +102,8 @@ set -e if [ -d %{product_dir}/plugins/opensearch-security ]; then sh %{product_dir}/plugins/opensearch-security/tools/install_demo_configuration.sh -y -i -s > %{log_dir}/install_demo_configuration.log 2>&1 fi -chown -R %{name}.%{name} %{config_dir} -chown -R %{name}.%{name} %{log_dir} +chown -R %{name}:%{name} %{config_dir} +chown -R %{name}:%{name} %{log_dir} # Apply PerformanceAnalyzer Settings chmod a+rw /tmp if ! grep -q '## OpenSearch Performance Analyzer' %{config_dir}/jvm.options; then