#1050862 ship systemd-tmpfiles /usr/lib/tmpfiles.d/tor.conf to fix permission issues

Package:
tor
Source:
tor
Description:
anonymizing overlay network for TCP
Submitter:
Date:
2023-08-30 11:27:04 UTC
Severity:
normal
#1050862#5
Date:
2023-08-30 11:17:00 UTC
From:
To:
Dear maintainer,

if file permissions in folder /var/lib/tor are messed up [1], i.e. if
any files or sub folders there are owned by anything other than Linux
user/group debian-tor, then Tor will fail to start.

Also if user /var/lib/tor was previously deleted, then the Tor systemd
unit should be able to restore it without needing to re-install the tor
package.

I would suggest the following /usr/lib/tmpfiles.d/tor.conf file contents:

d /var/lib/tor 02700 debian-tor debian-tor -
Z /var/lib/tor/* 0660 debian-tor debian-tor -

Kind regards,
Patrick Schleizer

[1] Which can happen in corner cases such as restoring backups, mounted
file-systems, changing underlying Qubes TempalteVMs or other user error.