Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ownership and permissions of files in OpenSearch-Dashboards deb and rpm packages #3952

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ echo " sudo systemctl enable opensearch-dashboards.service"
echo "### You can start opensearch-dashboards service by executing"
echo " sudo systemctl start opensearch-dashboards.service"

# 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}
# Set ownership and permissions
chmod -R u=rwX,g=rX,o= ${config_dir}

chown -R opensearch-dashboards.adm ${log_dir}
chmod 750 ${log_dir}

chown -R opensearch-dashboards.opensearch-dashboards ${data_dir}
chmod 750 ${data_dir}

chown -R opensearch-dashboards.opensearch-dashboards ${pid_dir}

exit 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ln -s ${data_dir} ${buildroot}${product_dir}/data
ln -s ${log_dir} ${buildroot}${product_dir}/logs

# Change Permissions
chmod -Rf a+rX,u+w,g-w,o-w ${buildroot}/*
chmod -Rf g-s ${buildroot}/*
chmod -Rf u=rwX,g=rX,o=rX ${buildroot}/*

exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ chmod 0755 %{buildroot}%{product_dir}/bin/*
ln -s %{data_dir} %{buildroot}%{product_dir}/data
ln -s %{log_dir} %{buildroot}%{product_dir}/logs
# Change Permissions
chmod -Rf a+rX,u+w,g-w,o-w %{buildroot}/*
chmod -Rf g-s %{buildroot}/*
chmod -Rf u=rwX,g=rX,o= %{buildroot}/etc
exit 0

%pre
Expand Down Expand Up @@ -101,7 +102,7 @@ exit 0

%files
# Permissions
%defattr(-, %{name}, %{name})
%defattr(-, root, root)

# Root dirs/docs/licenses
%dir %{product_dir}
Expand Down Expand Up @@ -130,9 +131,9 @@ exit 0
%{product_dir}/node_modules
%{product_dir}/plugins
%{product_dir}/src
%{log_dir}
%{pid_dir}
%dir %{data_dir}
%attr(750, %{name}, %{name}) %{log_dir}
%attr(750, %{name}, %{name}) %{pid_dir}
%dir %attr(750, %{name}, %{name}) %{data_dir}

# Symlinks
%{product_dir}/data
Expand Down
Loading