Skip to content

Commit

Permalink
helpers2.1: fix automagic chmod/chown for data_dir during restore
Browse files Browse the repository at this point in the history
  • Loading branch information
alexAubin authored Sep 9, 2024
1 parent 2c92a64 commit 46ddf1e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion helpers/helpers.v2.1.d/utils
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ _ynh_apply_default_permissions() {
chown "$app:$app" "$target"
return
fi
# If this is the install dir (so far this is the only way this helper is called with a directory)
# If this is the install dir (so far this is the only way this helper is called with a directory - along with $data_dir via ynh_restore?)
if [ "$target" == "${install_dir:-}" ]; then
# Read the group from the install_dir manifest resource
local group="$(ynh_read_manifest 'resources.install_dir.group' | sed 's/null//g' | sed "s/__APP__/$app/g" | cut -f1 -d:)"
Expand All @@ -252,6 +252,12 @@ _ynh_apply_default_permissions() {
chmod -R u=rwX,g=rX,o=--- "$target"
chown -R "$app:$group" "$target"
return
elif [ "$target" == "${data_dir:-}" ]; then
# Read the group from the data manifest resource
local group="$(ynh_read_manifest 'resources.data_dir.group' | sed 's/null//g' | sed "s/__APP__/$app/g" | cut -f1 -d:)"
chmod 750 "$target"

This comment has been minimized.

Copy link
@jedie

jedie Sep 9, 2024

Why not chmod -R u=rwX,g=rX,o=--- "$target" here, too.
Or chnage the chmod above?

chown -R "$app:${group:-$app}" "$target"
return
fi
fi

Expand Down

0 comments on commit 46ddf1e

Please sign in to comment.