Misc permission tweak, set everything as owned by root by default

This commit is contained in:
Alexandre Aubin 2021-03-25 16:03:18 +01:00
parent ac26925b91
commit 514112a538

View file

@ -330,7 +330,7 @@ ynh_add_config () {
# (cp won't overwrite ownership / modes by default...) # (cp won't overwrite ownership / modes by default...)
touch $destination touch $destination
chown root:root $destination chown root:root $destination
chmod 750 $destination chmod 640 $destination
cp -f "$template_path" "$destination" cp -f "$template_path" "$destination"
@ -725,11 +725,11 @@ _ynh_apply_default_permissions() {
if [ -z "$ynh_requirements" ] || [ "$ynh_requirements" == "null" ] || dpkg --compare-versions $ynh_requirements ge 4.2 if [ -z "$ynh_requirements" ] || [ "$ynh_requirements" == "null" ] || dpkg --compare-versions $ynh_requirements ge 4.2
then then
chmod o-rwx $target chmod o-rwx $target
chmod g-w $target
chown -R root:root $target
if ynh_system_user_exists $app if ynh_system_user_exists $app
then then
chown $app:$app $target chown $app:$app $target
else
chown root:root $target
fi fi
fi fi
} }