From utisoft@hotmail.com  Thu Jun  2 11:35:51 2011
Return-Path: <utisoft@hotmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82766106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 Jun 2011 11:35:51 +0000 (UTC)
	(envelope-from utisoft@hotmail.com)
Received: from blu0-omc1-s6.blu0.hotmail.com (blu0-omc1-s6.blu0.hotmail.com [65.55.116.17])
	by mx1.freebsd.org (Postfix) with ESMTP id 43D038FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 Jun 2011 11:35:51 +0000 (UTC)
Received: from BLU0-SMTP138 ([65.55.116.9]) by blu0-omc1-s6.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675);
	 Thu, 2 Jun 2011 04:35:51 -0700
Received: from zeus.bayofrum.net ([90.221.7.100]) by BLU0-SMTP138.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675);
	 Thu, 2 Jun 2011 04:35:48 -0700
Received: from zeus.bayofrum.net (crees@localhost [127.0.0.1])
	by zeus.bayofrum.net (8.14.4/8.14.4) with ESMTP id p52BAm7n021171
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 2 Jun 2011 12:10:49 +0100 (BST)
	(envelope-from crees@zeus.bayofrum.net)
Received: (from crees@localhost)
	by zeus.bayofrum.net (8.14.4/8.14.4/Submit) id p52BAmQ4021170;
	Thu, 2 Jun 2011 12:10:48 +0100 (BST)
	(envelope-from crees)
Message-Id: <BLU0-SMTP138537AA4A7D41F9113FA42A97C0@phx.gbl>
Date: Thu, 2 Jun 2011 12:10:48 +0100
From: Chris Rees <utisoft@gmail.com>
Sender: <utisoft@hotmail.com>
Reply-To: Chris Rees <utisoft@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] audio/shoutcast creates users manually
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         157526
>Category:       ports
>Synopsis:       [PATCH] audio/shoutcast creates users manually
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    crees
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 02 11:40:03 UTC 2011
>Closed-Date:    Sun Jul 03 14:48:46 UTC 2011
>Last-Modified:  Sun Jul  3 14:50:10 UTC 2011
>Originator:     Chris Rees
>Release:        FreeBSD 8.2-RELEASE-p1 i386
>Organization:
bayofrum
>Environment:
System: FreeBSD zeus.bayofrum.net 8.2-RELEASE-p1 FreeBSD 8.2-RELEASE-p1 #0: Sat Apr 30 15:09:06 BST 2011 root@zeus.bayofrum.net:/usr/obj/usr/src/sys/ZEUS i386


	
>Description:
	

	This port uses pkg-install to create new users instead of using USERS= and GROUPS=, and also tries to delete users on deinstall without prompting -- this is a problem if another installed port uses that username.
>How-To-Repeat:
	
>Fix:

	- Use USERS and GROUPS
	- Stop deleting users/groups on deinstall

	Submitted by: Chris Rees (utisoft@gmail.com)

	Please note that pkg-install and pkg-deinstall have been removed, and the patch for GIDs from ports/157525 is needed.  If this PR is committed first, please leave a note in the audit trail for 157525 to say the GIDs patch is not necessary.


--- audio-shoutcast.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/audio/shoutcast/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- Makefile	2 Sep 2010 21:17:32 -0000	1.16
+++ Makefile	2 Jun 2011 09:49:08 -0000
@@ -21,6 +21,8 @@
 
 CONFLICTS=	linux-shoutcast-[0-9]*
 
+USERS=		${PORTNAME}
+GROUPS=		${USERS}
 USE_RC_SUBR=	shoutcast.sh
 PORTDOCS=	README.TXT
 WRKSRC=		${WRKDIR}
@@ -46,7 +48,4 @@
 	@${INSTALL_DATA} ${WRKSRC}/README.TXT ${DOCSDIR}
 .endif
 
-post-install:
-	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-
 .include <bsd.port.mk>
Index: pkg-deinstall
===================================================================
RCS file: pkg-deinstall
diff -N pkg-deinstall
--- pkg-deinstall	5 Jun 2006 10:35:35 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-if [ "$2" != "POST-DEINSTALL" ]; then
-        exit 0
-fi
-
-SC_GROUP=shoutcast
-SC_USER=shoutcast
-SC_SHELL=/bin/sh
-SC_HOME=/nonexistent
-PW=/usr/sbin/pw
-
-pw groupdel shoutcast >/dev/null 2>&1
-pw userdel shoutcast >/dev/null 2>&1
-
-exit 0
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install	31 Mar 2007 19:56:18 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-if [ "$2" != "POST-INSTALL" ]; then
-	exit 0
-fi
-
-SC_GROUP=shoutcast
-SC_USER=shoutcast
-SC_SHELL=/bin/sh
-SC_HOME=/nonexistent
-PW="/usr/sbin/pw"
-
-if ! ${PW} show group ${SC_GROUP} -q >/dev/null; then
-	gid=210
-	while ${PW} show group -g ${gid} -q >/dev/null; do
-		gid=`expr ${gid} + 1`
-	done
-	if ! ${PW} add group ${SC_GROUP} -g ${gid}; then
-		e=$?
-		echo "*** Failed to add group \`${SC_GROUP}'. Please add it manually."
-		exit ${e}
-	fi
-	echo "*** Added group \`${SC_GROUP}' (id ${gid})"
-else
-	gid=`${PW} show group ${SC_GROUP} 2>/dev/null | cut -d: -f3`
-fi
-
-if ! ${PW} show user ${SC_USER} -q >/dev/null; then
-	uid=210
-	while ${PW} show user -u ${uid} -q >/dev/null; do
-		uid=`expr ${uid} + 1`
-	done
-	if ! ${PW} add user ${SC_USER} -u ${uid} -g ${gid} -d "${SC_HOME}" \
-	-c "Shoutcast sandbox" -s "${SC_SHELL}" -p "*" \
-	; then
-		e=$?
-		echo "*** Failed to add user \`${SC_USER}'. Please add it manually."
-		exit ${e}
-	fi
-	echo "*** Added user \`${SC_USER}' (id ${uid})"
-else
-	if ! ${PW} mod user ${SC_USER} -g ${gid} -d "${SC_HOME}" \
-	-c "Shoutcast sandbox" -s "${SC_SHELL}" -p "*" \
-	; then
-		e=$?
-		echo "*** Failed to update user \`${SC_USER}'."
-		exit ${e}
-	fi
-		echo "*** Updated user \`${SC_USER}'."
-fi
--- audio-shoutcast.patch ends here ---



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->pgollucci 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Jun 2 11:40:18 UTC 2011 
Responsible-Changed-Why:  
pgollucci@ wants his PRs (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157526 
Responsible-Changed-From-To: pgollucci->crees 
Responsible-Changed-By: crees 
Responsible-Changed-When: Wed Jun 22 16:50:00 UTC 2011 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=157526 
State-Changed-From-To: open->closed 
State-Changed-By: crees 
State-Changed-When: Sun Jul 3 14:48:45 UTC 2011 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/157526: commit references a PR
Date: Sun,  3 Jul 2011 14:48:37 +0000 (UTC)

 crees       2011-07-03 14:48:28 UTC
 
   FreeBSD ports repository
 
   Modified files:
     audio/shoutcast      Makefile 
   Removed files:
     audio/shoutcast      pkg-deinstall pkg-install 
   Log:
   - Use USERS and GROUPS
   - Stop deleting users/groups on deinstall
   
   PR:             ports/157526
   Submitted by:   Chris Rees <utisoft@gmail.com>
   Approved by:    rene (mentor)
   
   Revision  Changes    Path
   1.17      +2 -3      ports/audio/shoutcast/Makefile
   1.3       +0 -16     ports/audio/shoutcast/pkg-deinstall (dead)
   1.5       +0 -50     ports/audio/shoutcast/pkg-install (dead)
 _______________________________________________
 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:
