Index: head/security/tor-devel/Makefile =================================================================== --- head/security/tor-devel/Makefile +++ head/security/tor-devel/Makefile @@ -2,7 +2,8 @@ # $FreeBSD$ PORTNAME= tor -DISTVERSION= 0.3.2.9 +DISTVERSION= 0.3.3.1 +DISTVERSIONSUFFIX= -alpha CATEGORIES= security net ipv6 MASTER_SITES= TOR PKGNAMESUFFIX= -devel Index: head/security/tor-devel/distinfo =================================================================== --- head/security/tor-devel/distinfo +++ head/security/tor-devel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1515842195 -SHA256 (tor-0.3.2.9.tar.gz) = 435a7b91aa98d8b1a0ac1f60ca30c0ff3665b18a02e570bab5fe27935829160f -SIZE (tor-0.3.2.9.tar.gz) = 6250442 +TIMESTAMP = 1517017645 +SHA256 (tor-0.3.3.1-alpha.tar.gz) = 0a7c587645045eb37f3733ce75068fb5dea385b988e2a49c572b9e9193b9333a +SIZE (tor-0.3.3.1-alpha.tar.gz) = 6317585 Index: head/security/tor-devel/files/tor.in =================================================================== --- head/security/tor-devel/files/tor.in +++ head/security/tor-devel/files/tor.in @@ -21,6 +21,7 @@ # tor_disable_default_instance (str): Doesn't run the default instance. # Only valid when tor_instances is used. # Default: NO +# tor_setuid (str): Runtime setuid. Default: NO # # The instance definition that tor_instances expects: # inst_name{:inst_conf:inst_user:inst_group:inst_pidfile:inst_data_dir} @@ -42,6 +43,7 @@ : ${tor_pidfile="/var/run/tor/tor.pid"} : ${tor_datadir="/var/db/tor"} : ${tor_disable_default_instance="NO"} +: ${tor_setuid="NO"} instance=${slave_instance} if [ -n "${instance}" ]; then @@ -111,6 +113,18 @@ command="%%PREFIX%%/bin/${name}" command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir}" extra_commands="reload" + +if [ $tor_setuid = "YES" ]; then + if ! grep -q "^User ${tor_user}$" ${tor_conf}; then + echo "User ${tor_user}" >> ${tor_conf} + fi + tor_user="root" + tor_group="wheel" +else + if grep -q "^User ${tor_user}$" ${tor_conf}; then + sed -i '' -e "s/^User ${tor_user}$//" ${tor_conf} + fi +fi if ! run_rc_command "$1"; then exit_code=1