ensure Tor daemon files have correct permissions

Set permissions for /var/lib/tor and /var/ipfire/tor to
tor:tor, regardless whether Tor user has been created before
or not.

This ensures Tor starts properly on existing systems after
reinstallation of the add-on. Thanks to Michael for the hint.

Further, a comment for new Tor user in /etc/passwd has been added.

Fixes #11779.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Peter Müller
2019-03-15 17:00:00 +00:00
committed by Michael Tremer
parent a46903cce3
commit a10b0e5b44

View File

@@ -29,12 +29,12 @@ if ! getent group tor &>/dev/null; then
fi
if ! getent passwd tor; then
useradd -u 119 -g tor -d /var/empty -s /bin/false tor
# Adjust some folder permission for new UID/GID
chown -R tor:tor /var/lib/tor /var/ipfire/tor
useradd -u 119 -g tor -c "Tor daemon user" -d /var/empty -s /bin/false tor
fi
# Adjust some folder permission for new UID/GID
chown -R tor:tor /var/lib/tor /var/ipfire/tor
extract_files
restore_backup ${NAME}
start_service --background ${NAME}