From nobody@FreeBSD.org  Wed Mar 24 18:46:24 2010
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 1DD89106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 24 Mar 2010 18:46:24 +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 08D958FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 24 Mar 2010 18:46:24 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o2OIkNig040864
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 24 Mar 2010 18:46:23 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o2OIkNm3040863;
	Wed, 24 Mar 2010 18:46:23 GMT
	(envelope-from nobody)
Message-Id: <201003241846.o2OIkNm3040863@www.freebsd.org>
Date: Wed, 24 Mar 2010 18:46:23 GMT
From: Michael Reynolds <michael.reynolds@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: rc.conf should allow mac label configuration
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         145009
>Category:       conf
>Synopsis:       [patch] rc.subr(8): rc.conf should allow mac label configuration
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-rc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 24 18:50:01 UTC 2010
>Closed-Date:    
>Last-Modified:  Wed Mar 24 23:21:45 UTC 2010
>Originator:     Michael Reynolds
>Release:        8.0-STABLE
>Organization:
>Environment:
n/a
>Description:
rc.conf, via rc.subr, should allow service specific labels to be set, so as to efficiently handle security, and ensure a working machine after enabling MAC.
>How-To-Repeat:

>Fix:
Apply the affixed patch, add this (as an example) to your rc.conf:

auditd_label="biba/high,lomac/high,mls/high,partition/equal"


Patch attached with submission follows:

--- etc/rc.subr	2009-12-30 14:25:40.000000000 -0500
+++ /etc/rc.subr	2010-03-18 11:39:16.000000000 -0400
@@ -646,7 +646,8 @@
 	fi
 	eval _chdir=\$${name}_chdir	_chroot=\$${name}_chroot \
 	    _nice=\$${name}_nice	_user=\$${name}_user \
-	    _group=\$${name}_group	_groups=\$${name}_groups
+	    _group=\$${name}_group	_groups=\$${name}_groups \
+	    _label=\$${name}_label
 
 	if [ -n "$_user" ]; then	# unset $_user if running as that user
 		if [ "$_user" = "$(eval $IDCMD)" ]; then
@@ -726,10 +727,12 @@
 			if [ -n "$_chroot" ]; then
 				_doit="\
 ${_nice:+nice -n $_nice }\
+${_label:+setpmac $_label }\
 chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
 $_chroot $command $rc_flags $command_args"
 			else
 				_doit="\
+${_label:+setpmac $_label }\
 ${_chdir:+cd $_chdir && }\
 $command $rc_flags $command_args"
 				if [ -n "$_user" ]; then


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Mar 24 23:21:15 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

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