From sec@42.org  Sat Feb 24 19:14:40 2007
Return-Path: <sec@42.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id B662A16A403
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Feb 2007 19:14:40 +0000 (UTC)
	(envelope-from sec@42.org)
Received: from ice.42.org (ice.42.org [194.77.85.2])
	by mx1.freebsd.org (Postfix) with ESMTP id 6254313C4A8
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 24 Feb 2007 19:14:40 +0000 (UTC)
	(envelope-from sec@42.org)
Received: by ice.42.org (Postfix, from userid 1000)
	id 1A066C4A6; Sat, 24 Feb 2007 19:55:30 +0100 (CET)
Message-Id: <20070224185530.1A066C4A6@ice.42.org>
Date: Sat, 24 Feb 2007 19:55:30 +0100 (CET)
From: Stefan `Sec` Zehl <sec@42.org>
Reply-To: Stefan `Sec` Zehl <sec@42.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: x11-servers/xorg-fontserver rc.d/xfs.sh script missing "-user"
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         109497
>Category:       ports
>Synopsis:       x11-servers/xorg-fontserver rc.d/xfs.sh script missing "-user"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-x11
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 24 19:20:04 GMT 2007
>Closed-Date:    Tue Aug 28 21:31:14 GMT 2007
>Last-Modified:  Tue Aug 28 21:31:14 GMT 2007
>Originator:     Stefan `Sec` Zehl
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD ice 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #36: Sun Oct 1 00:50:35 CEST 2006 root@:/export/obj/export/src/sys/ICE i386


	
>Description:

There is usually no need to run xfs as root, and in fact, I have been running
xfs as user nobody for quite some time.

I was starting xfs from /etc/rc.local as

/usr/X11R6/bin/xfs -daemon -user nobody

I tried to convert it to use /usr/X11R6/etc/rc.d/xfs.sh, but it lacked an
option to set "-user " as commandline switch.

>How-To-Repeat:
	
>Fix:

I created a small patch:

--- xfs.sh.org	Sat Feb 24 19:53:01 2007
+++ xfs.sh	Sat Feb 24 19:54:06 2007
@@ -29,6 +29,8 @@
 
 command="%%PREFIX%%/bin/${name}"
 command_args="-config ${xfs_config} -daemon"
+[ ! -z "$xfs_user" ] && command_args="${command_args} -user ${xfs_user}"
+xfs_user= # unset, as automatic scripts try to use that variable, too
 required_files="$xfs_config"
 extra_commands="reload"
 
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-x11 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Feb 24 19:20:17 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109497 
State-Changed-From-To: open->closed 
State-Changed-By: flz 
State-Changed-When: Mon Apr 16 11:40:38 UTC 2007 
State-Changed-Why:  
I just checked and other OS'es seem to run it as root as well. 

If this is a real concern to you, just set xfs_flags="-user nobody" in 
/etc/rc.conf. I think this is what you're looking for. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109497 
State-Changed-From-To: closed->analyzed 
State-Changed-By: flz 
State-Changed-When: Wed Apr 18 11:23:11 UTC 2007 
State-Changed-Why:  
Mark as analyzed, it'll be fixed when X.org 7.2 is merged. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109497 
State-Changed-From-To: analyzed->feedback 
State-Changed-By: linimon 
State-Changed-When: Fri May 25 02:35:51 UTC 2007 
State-Changed-Why:  
To submitter: did the upgrade to xorg 7.2 fix this problem? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109497 
State-Changed-From-To: feedback->closed 
State-Changed-By: flz 
State-Changed-When: Tue Aug 28 21:30:48 UTC 2007 
State-Changed-Why:  
I'm pretty sure it did. 

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