From jarrod@wallace.netleader.com.au  Sat Apr  7 05:09:50 2007
Return-Path: <jarrod@wallace.netleader.com.au>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 98D0B16A402
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  7 Apr 2007 05:09:50 +0000 (UTC)
	(envelope-from jarrod@wallace.netleader.com.au)
Received: from wallace.netleader.com.au (wallace.netleader.com.au [203.122.246.247])
	by mx1.freebsd.org (Postfix) with ESMTP id C8D1B13C469
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  7 Apr 2007 05:09:49 +0000 (UTC)
	(envelope-from jarrod@wallace.netleader.com.au)
Received: from wallace.netleader.com.au (localhost [127.0.0.1])
	by wallace.netleader.com.au (8.13.8/8.13.8) with ESMTP id l3759jrX039508
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 7 Apr 2007 14:39:47 +0930 (CST)
	(envelope-from jarrod@wallace.netleader.com.au)
Received: (from jarrod@localhost)
	by wallace.netleader.com.au (8.13.8/8.13.8/Submit) id l3759i5F039507;
	Sat, 7 Apr 2007 14:39:44 +0930 (CST)
	(envelope-from jarrod)
Message-Id: <200704070509.l3759i5F039507@wallace.netleader.com.au>
Date: Sat, 7 Apr 2007 14:39:44 +0930 (CST)
From: Jarrod Sayers <jarrod@wallace.netleader.com.au>
Reply-To: Jarrod Sayers <jarrod@netleader.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [maintainer-update] net-mgmt/nagios: Consistent UID and GID of 181 on installation
X-Send-Pr-Version: 3.113
X-GNATS-Notify: jarrod@netleader.com.au

>Number:         111345
>Category:       ports
>Synopsis:       [maintainer-update] net-mgmt/nagios: Consistent UID and GID of 181 on installation
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 07 05:10:01 GMT 2007
>Closed-Date:    Sat Apr 07 14:29:24 GMT 2007
>Last-Modified:  Sat Apr  7 14:30:09 GMT 2007
>Originator:     Jarrod Sayers
>Release:        FreeBSD 6.2-RELEASE-p3 i386
>Organization:
>Environment:
System: FreeBSD wallace.netleader.com.au 6.2-RELEASE-p3 FreeBSD 6.2-RELEASE-p3 #71: Fri Mar 16 20:09:23 CST 2007 root@wallace.netleader.com.au:/usr/obj/usr/src/sys/WALLACE i386
>Description:
The changes contained within this patch force the ports pkg-install script to
use a statically assigned UID and GID of 181 as per ports/[UG]IDs.  Attempts to
install the port on a fresh system will use the new ID's however where the user
or group name already exists, no attempt is made to renumber anything.

To quickly shift dynamic ID's over to the new static ones, the following may be
of some help:

wallace# /usr/local/etc/rc.d/nagios stop
Stopping nagios.
wallace# find / -user nagios -exec chown 181 {} \;
wallace# find / -group nagios -exec chgrp 181 {} \;
wallace# pw usermod nagios -u 181
wallace# pw groupmod nagios -g 181
wallace# /usr/local/etc/rc.d/nagios start
Performing sanity check of nagios configuration: OK
Starting nagios.
wallace# 

Thanks to Peter Losher and Kris Kennaway for their occasional prodding, reminding
me to complete this ;-)
>How-To-Repeat:
>Fix:
Downloadable diff from:
http://www.netleader.com.au/~jarrod/FreeBSD/net-mgmt-nagios-181-uid-gid.diff

--- net-mgmt-nagios-181-uid-gid.diff begins here ---
--- ports/net-mgmt/nagios/Makefile.orig	Tue Mar 13 23:57:13 2007
+++ ports/net-mgmt/nagios/Makefile	Sat Apr  7 14:14:23 2007
@@ -7,6 +7,7 @@
 
 PORTNAME=	nagios
 PORTVERSION=	2.8
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	nagios
@@ -32,6 +33,9 @@
 NAGIOSGROUP?=	nagios
 NAGIOSDIR?=	/var/spool/nagios
 
+NAGIOSUID=	181
+NAGIOSGID=	${NAGIOSUID}
+
 NAGIOSWWWDIR?=	www/nagios
 NAGIOSHTMURL?=	/nagios
 NAGIOSCGIURL?=	${NAGIOSHTMURL}/cgi-bin
@@ -74,6 +78,8 @@
 		NAGIOSWWWDIR=${NAGIOSWWWDIR} \
 		NAGIOSUSER=${NAGIOSUSER} \
 		NAGIOSGROUP=${NAGIOSGROUP} \
+		NAGIOSUID=${NAGIOSUID} \
+		NAGIOSGID=${NAGIOSGID} \
 		NAGIOSHTMURL=${NAGIOSHTMURL} \
 		NAGIOSCGIURL=${NAGIOSCGIURL} \
 		WWWGRP=${WWWGRP}
--- ports/net-mgmt/nagios/files/pkg-install.in.orig	Mon Jan  9 11:24:01 2006
+++ ports/net-mgmt/nagios/files/pkg-install.in	Sat Apr  7 14:13:03 2007
@@ -6,6 +6,8 @@
 NAGIOSDIR=%%NAGIOSDIR%%
 NAGIOSUSER=%%NAGIOSUSER%%
 NAGIOSGROUP=%%NAGIOSGROUP%%
+NAGIOSUID=%%NAGIOSUID%%
+NAGIOSGID=%%NAGIOSGID%%
 
 ask() {
   local question default answer
@@ -46,7 +48,8 @@
   else
     echo "You need a \"${NAGIOSGROUP}\" group."
     if yesno "Would you like me to create it" "YES"; then
-      /usr/sbin/pw groupadd "${NAGIOSGROUP}" -h - || exit
+      /usr/sbin/pw groupadd "${NAGIOSGROUP}" -g "${NAGIOSGID}" -h - || \
+        /usr/sbin/pw groupadd "${NAGIOSGROUP}" -h - || exit
       echo "Done."
     else
       echo "Please create the \"${NAGIOSGROUP}\" group manually and try again."
@@ -59,7 +62,9 @@
   else
     echo "You need a \"${NAGIOSUSER}\" user."
     if yesno "Would you like me to create it" "YES"; then
-      /usr/sbin/pw useradd "${NAGIOSUSER}" -g "${NAGIOSGROUP}" -h - -d "${NAGIOSDIR}" \
+      /usr/sbin/pw useradd "${NAGIOSUSER}" -u "${NAGIOSUID}" -g "${NAGIOSGROUP}" -h - -d "${NAGIOSDIR}" \
+        -s /sbin/nologin -c "Nagios pseudo-user" || \
+        /usr/sbin/pw useradd "${NAGIOSUSER}" -g "${NAGIOSGROUP}" -h - -d "${NAGIOSDIR}" \
         -s /sbin/nologin -c "Nagios pseudo-user" || exit
     else
       echo "Please create the \"${NAGIOSUSER}\" user manually and try again."
--- net-mgmt-nagios-181-uid-gid.diff ends here ---


>Release-Note:
>Audit-Trail:
Class-Changed-From-To: maintainer-update->change-request 
Class-Changed-By: edwin 
Class-Changed-When: Sat Apr 7 05:10:11 UTC 2007 
Class-Changed-Why:  
Fix category (submitter is not maintainer) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111345 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sat Apr 7 05:10:27 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111345 
State-Changed-From-To: feedback->open 
State-Changed-By: edwin 
State-Changed-When: Sat Apr 7 05:55:31 UTC 2007 
State-Changed-Why:  
Submitter is maintainer (please use correct email address next time 
to speed up the process) 


Class-Changed-From-To: change-request->maintainer-update 
Class-Changed-By: edwin 
Class-Changed-When: Sat Apr 7 05:55:31 UTC 2007 
Class-Changed-Why:  
Over to myself for documentation and implementation 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111345 
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Sat Apr 7 14:29:20 UTC 2007 
State-Changed-Why:  
Committed with an entry in UPDATING. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111345 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/111345: commit references a PR
Date: Sat,  7 Apr 2007 14:25:55 +0000 (UTC)

 rafan       2007-04-07 14:25:48 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-mgmt/nagios      Makefile 
     net-mgmt/nagios/files pkg-install.in 
   Log:
   - Use registered UID and GID. See UPDATING for migration.
   
   PR:             ports/111345
   Submitted by:   Jarrod Sayers <jarrod at netleader.com.au> (maintainer)
   
   Revision  Changes    Path
   1.60      +6 -0      ports/net-mgmt/nagios/Makefile
   1.2       +8 -3      ports/net-mgmt/nagios/files/pkg-install.in
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/111345: commit references a PR
Date: Sat,  7 Apr 2007 14:29:18 +0000 (UTC)

 rafan       2007-04-07 14:29:13 UTC
 
   FreeBSD ports repository
 
   Modified files:
     .                    UPDATING 
   Log:
   - Add entry for net-mgmt/nagios uid/gid changes (from dynamic -> static)
   
   PR:             ports/111345
   Submitted by:   Jarrod Sayers <jarrod at netleader.com.au> (maintainer)
   
   Revision  Changes    Path
   1.496     +18 -1     ports/UPDATING
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
