1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/agendav_ynh.git synced 2024-09-03 20:36:12 +02:00

[fix] Properly chmod installed files. Fixes #19

This commit is contained in:
Julien Malik 2017-02-06 09:40:19 +01:00
parent 318cec9dd5
commit c7acda299d
2 changed files with 5 additions and 2 deletions

View file

@ -77,12 +77,14 @@ sed -i "s@{CALDAV_DOMAIN}@${caldav_domain}@g" "$conf_path"
# Install files and set permissions
sudo mv "$TMPDIR" "$DESTDIR"
sudo useradd -c "$app system account" \
-d /var/www/$app --system --user-group $app --shell /usr/sbin/nologin \
|| ynh_die "Unable to create $app system account"
# Protect source code against modifications
sudo chown -hR root: "$DESTDIR"
sudo find "${DESTDIR}" -type f -exec chown root:root {} \; -exec chmod 644 {} \;
sudo find "${DESTDIR}" -type d -exec chown root:root {} \; -exec chmod 755 {} \;
# Only agendav user should write here
sudo chown -hR $app: "${DESTDIR}/web/var/cache/"{profiler,twig}

View file

@ -85,7 +85,8 @@ if ! id -u $app > /dev/null 2>&1 ; then
fi
# Protect source code against modifications
sudo chown -hR root: "$DESTDIR"
sudo find "${DESTDIR}" -type f -exec chown root:root {} \; -exec chmod 644 {} \;
sudo find "${DESTDIR}" -type d -exec chown root:root {} \; -exec chmod 755 {} \;
# Only agendav user should write here
sudo chown -hR $app: "${DESTDIR}/web/var/cache/"{profiler,twig}