diff options
author | Peter Palfrader <peter@palfrader.org> | 2008-01-21 14:58:20 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2008-01-21 14:58:20 +0000 |
commit | d98d1ea0d9d0d8cb879aa5954bf4fedf4ae8d2a4 (patch) | |
tree | c722e3056dfe9b429cc777ba77add2873cb2a3b3 /debian/tor.postinst | |
parent | 3d3dbe90abb0a0d05213974d205ae29c5af5b55e (diff) | |
download | tor-d98d1ea0d9d0d8cb879aa5954bf4fedf4ae8d2a4.tar.gz tor-d98d1ea0d9d0d8cb879aa5954bf4fedf4ae8d2a4.zip |
postinst: We were only fixing the permissions of /var/{lib,run,log}/tor when we
were not upgrading. Unfortunately the check doesn't work all that well usually
in cases where the package was removed (not purged) and then later re-installed
again. Now we ensure proper ownership and modes for all the directories and
files below /var/{lib,run,log}/tor (the dirs themselves included) every time we
run postinst.
svn:r13207
Diffstat (limited to 'debian/tor.postinst')
-rw-r--r-- | debian/tor.postinst | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/debian/tor.postinst b/debian/tor.postinst index 0d2a4dd415..efc7e25143 100644 --- a/debian/tor.postinst +++ b/debian/tor.postinst @@ -30,28 +30,18 @@ else debian-tor fi -# ch{owning,moding} things around -# We will do nothing across upgrades. - -if [ "$2" = "" ]; then - for i in lib log run; do - chown -R debian-tor:debian-tor /var/$i/tor - chmod -R 700 /var/$i/tor - find /var/$i/tor -type f -exec chmod 600 '{}' ';' - done - chgrp -R adm /var/log/tor - chmod -R g+rX /var/log/tor - chmod g+s /var/log/tor -else - # fix permissions of logs after 0.0.8+0.0.9pre5-1 - if [ "$1" = "configure" ]; then - if dpkg --compare-versions "$2" le "0.0.8+0.0.9pre5-1" ; then - chgrp -R adm /var/log/tor - chmod -R g+rX /var/log/tor - chmod g+s /var/log/tor - fi - fi -fi + +find /var/lib/tor ! -user debian-tor -o ! -group debian-tor -print0 | xargs -0 --no-run-if-empty chown debian-tor:debian-tor +find /var/lib/tor -type d -print0 | xargs -0 --no-run-if-empty chmod 02700 +find /var/lib/tor -type f -print0 | xargs -0 --no-run-if-empty chmod 00600 + +find /var/run/tor ! -user debian-tor -o ! -group debian-tor -print0 | xargs -0 --no-run-if-empty chown debian-tor:debian-tor +find /var/run/tor -type d -print0 | xargs -0 --no-run-if-empty chmod 02750 +find /var/run/tor -type f -print0 | xargs -0 --no-run-if-empty chmod 00600 + +find /var/log/tor ! -user debian-tor -o ! -group adm -print0 | xargs -0 --no-run-if-empty chown debian-tor:adm +find /var/log/tor -type d -print0 | xargs -0 --no-run-if-empty chmod 02750 +find /var/log/tor -type f -print0 | xargs -0 --no-run-if-empty chmod 00640 #DEBHELPER# |