From b1e0256debf8b5233959d4f533c321b2b2291556 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 19 Jan 2016 13:54:54 +0000 Subject: - Make the tor ports create /var/run/tor and /var/log/tor directories, so it can work without any manual actions - Remove note of these manual actions from pkg-message - Change mentions of /var/lib/tor to /var/db/tor in example configs and documentation - Mention in UPDATING that if /var/log/tor _file_ was created before it should be now moved away PR: 206235 Submitted by: amdmi3 Approved by: bf (maintainer) --- security/tor/Makefile | 8 ++++++++ security/tor/files/pkg-message.in | 13 +++---------- security/tor/pkg-plist | 2 ++ 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'security/tor') diff --git a/security/tor/Makefile b/security/tor/Makefile index da3af82250c8..146c04a300d5 100644 --- a/security/tor/Makefile +++ b/security/tor/Makefile @@ -3,6 +3,7 @@ PORTNAME= tor PORTVERSION= 0.2.7.6 +PORTREVISION= 1 CATEGORIES= security net ipv6 MASTER_SITES= TOR @@ -106,6 +107,10 @@ CONFIGURE_ARGS+= --disable-transparent post-patch: @${REINPLACE_CMD} -E -e "s@(-z) (relro|now)@-Wl,\1,\2@g" \ ${WRKSRC}/configure + @${REINPLACE_CMD} -e 's|lib/tor|db/tor|' \ + ${WRKSRC}/src/config/torrc.*.in \ + ${WRKSRC}/doc/tor.1.* \ + ${WRKSRC}/doc/tor.html.in post-patch-STATIC_TOR-off: @${REINPLACE_CMD} -e "s@-ltcmalloc@${LOCALBASE}/lib/libtcmalloc.so@" \ @@ -119,6 +124,9 @@ post-configure: @${REINPLACE_CMD} -e '\|^nodist_man1_MANS =|s|$$|$$(install_mans:=.1)|' \ ${WRKSRC}/Makefile +post-install: + @${MKDIR} ${STAGEDIR}/var/log/tor ${STAGEDIR}/var/run/tor + .if ! ${PORT_OPTIONS:MTOR2WEB} check regression-test test: build @cd ${BUILD_WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \ diff --git a/security/tor/files/pkg-message.in b/security/tor/files/pkg-message.in index cf0accc2329e..a3155b04a889 100644 --- a/security/tor/files/pkg-message.in +++ b/security/tor/files/pkg-message.in @@ -3,17 +3,10 @@ To enable the tor server, set tor_enable="YES" in your /etc/rc.conf and edit %%PREFIX%%/etc/tor/torrc as desired. (However, note that the %%PREFIX%%/etc/rc.d/tor rc.subr script can override some torrc options: see that script for details.) To use the torify script, install -the net/torsocks port. After installing tor for the first time, or after -a major update of tor, you should: +the net/torsocks port. -rm -r /var/db/tor /var/run/tor -mkdir -p /var/db/tor/data /var/run/tor -touch /var/log/tor -chown -R _tor:_tor /var/db/tor /var/log/tor /var/run/tor -chmod -R 700 /var/db/tor - -before starting the tor server. Tor users are strongly advised to prevent traffic -analysis that exploits sequential IP IDs by setting: +Tor users are strongly advised to prevent traffic analysis that +exploits sequential IP IDs by setting: sysctl net.inet.ip.random_id=1 diff --git a/security/tor/pkg-plist b/security/tor/pkg-plist index 1d8a482892cc..157ef514dd66 100644 --- a/security/tor/pkg-plist +++ b/security/tor/pkg-plist @@ -9,3 +9,5 @@ man/man1/tor.1.gz man/man1/torify.1.gz %%DATADIR%%/geoip %%DATADIR%%/geoip6 +@dir(_tor,_tor,750) /var/run/tor +@dir(_tor,_tor,750) /var/log/tor -- cgit v1.2.3