From nobody@FreeBSD.org  Sun Nov 23 13:17:43 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41BCC1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 23 Nov 2008 13:17:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 378688FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 23 Nov 2008 13:17:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mANDHgCD042933
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 23 Nov 2008 13:17:42 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id mANDHg6g042932;
	Sun, 23 Nov 2008 13:17:42 GMT
	(envelope-from nobody)
Message-Id: <200811231317.mANDHg6g042932@www.freebsd.org>
Date: Sun, 23 Nov 2008 13:17:42 GMT
From: Daniel Walter <d.walter@0x90.at>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [security/tor] tor rc file is wrong for current tor
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         129083
>Category:       ports
>Synopsis:       [security/tor] tor rc file is wrong for current tor
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 23 13:20:01 UTC 2008
>Closed-Date:    Sat Nov 29 21:19:05 UTC 2008
>Last-Modified:  Sat Nov 29 21:19:05 UTC 2008
>Originator:     Daniel Walter
>Release:        6.3
>Organization:
>Environment:
FreeBSD www.0x90.at 6.3-STABLE FreeBSD 6.3-STABLE #1: Mon Apr  7 17:11:29 CEST 2008     root@www.0x90.at:/usr/obj/usr/src/sys/0x90  i386

>Description:
tor rc script drops privileges before starting tor, since tor uses a new setuid/ setgid mechanism it must be started either as root or without the --User option


>How-To-Repeat:
upgrade tor tor-v0.2.32
try to start tor via /usr/local/etc/rc.d/tor start


>Fix:
There are two possible fixes for it:

1) start tor as root and specify the tor user

--- tor.orig	2008-11-23 14:18:26.000000000 +0100
+++ tor	2008-11-23 14:18:52.000000000 +0100
@@ -29,8 +29,6 @@
 
 : ${tor_enable="NO"}
 : ${tor_conf="/usr/local/etc/tor/torrc"}
-: ${tor_user="_tor"}
-: ${tor_group="_tor"}
 : ${tor_pidfile="/var/run/tor/tor.pid"}
 : ${tor_logfile="/var/log/tor"}
 : ${tor_datadir="/var/db/tor"}
@@ -39,7 +37,7 @@
 required_dirs=${tor_datadir}
 pidfile=${tor_pidfile}
 command="/usr/local/bin/${name}"
-command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} --User ${tor_user} --Group ${tor_group} --Log notice\ file\ ${tor_logfile}"
+command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} --User _tor --Log notice\ file\ ${tor_logfile}"
 extra_commands="log"
 log_cmd="${name}_log"



2) remove User and Group options and start tor as user _tor
--- tor.orig	2008-11-23 14:18:26.000000000 +0100
+++ tor	2008-11-23 14:19:30.000000000 +0100
@@ -39,7 +39,7 @@
 required_dirs=${tor_datadir}
 pidfile=${tor_pidfile}
 command="/usr/local/bin/${name}"
-command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} --User ${tor_user} --Group ${tor_group} --Log notice\ file\ ${tor_logfile}"
+command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} --Log notice\ file\ ${tor_logfile}"
 extra_commands="log"
 log_cmd="${name}_log"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Nov 23 13:20:30 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=129083 
State-Changed-From-To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Sat Nov 29 21:19:04 UTC 2008 
State-Changed-Why:  
is already fixed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=129083 
>Unformatted:
