Bug 157608

Summary: Fix port: mail/dcc-dccd should use USERS
Product: Ports & Packages Reporter: Chris Rees <utisoft>
Component: Individual Port(s)Assignee: Chris Rees <crees>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Chris Rees 2011-06-04 13:10:11 UTC
	

	This port uses pkg-install to create new users instead of using USERS= and GROUPS=

Fix: - Use USERS and GROUPS

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

	Please note that files/pkg-deinstall.in has been removed




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.--xDshcpBPp6AJBwkeY5mPKJ5Utf8RdICRo1PLtF8CAgHYj9G8
Content-Type: text/plain; name="mail-dcc-dccd.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="mail-dcc-dccd.patch"

Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/dcc-dccd/Makefile,v
retrieving revision 1.46
diff -u -r1.46 Makefile
--- Makefile	31 Jan 2010 03:45:20 -0000	1.46
+++ Makefile	4 Jun 2011 10:50:48 -0000
@@ -56,9 +56,10 @@
 ## User for DCC files and SUID binaries
 #
 DCCUSER?=	dcc
-DCCUID?=	112
 DCCGROUP?=	dcc
-DCCGID?=	112
+
+USERS=		${DCCUSER}
+GROUPS=		${DCCGROUP}
 
 PLIST_SUB+=	DCCUSER="${DCCUSER}"
 
@@ -69,9 +70,8 @@
 
 .include <bsd.port.options.mk>
 
-SUB_FILES=		pkg-install pkg-deinstall pkg-message
-SUB_LIST+=		WRKSRC=${WRKSRC} DCCUSER=${DCCUSER} DCCUID=${DCCUID} \
-			DCCGROUP=${DCCGROUP} DCCGID=${DCCGID} DCCHOME=${DCCHOME}
+SUB_FILES=		pkg-install pkg-message
+SUB_LIST+=		WRKSRC=${WRKSRC} DCCHOME=${DCCHOME}
 
 ## /var/dcc home support
 #
@@ -176,10 +176,6 @@
 	@${ECHO_MSG} 'A description of ALT_HOME may be found in the port's Makefile.'
 	@${ECHO_MSG} ' '
 
-pre-install:
-	@${SETENV} PKG_PREFIX=${PREFIX} \
-	${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
-
 post-install:
 
 ## Make certain DCC's config files are owned by DCC's user
Index: files/pkg-deinstall.in
===================================================================
RCS file: files/pkg-deinstall.in
diff -N files/pkg-deinstall.in
--- files/pkg-deinstall.in	31 Jan 2010 03:45:21 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-# $FreeBSD: ports/mail/dcc-dccd/files/pkg-deinstall.in,v 1.1 2010/01/31 03:45:21 pgollucci Exp $
-
-if [ "$2" != "POST-DEINSTALL" ]; then
-	exit 0
-fi
-
-DCCUSER=%%DCCUSER%%
-
-if pw usershow "${DCCUSER}" 2>/dev/null 1>&2; then
-	echo "To delete ${DCCUSER} user permanently, use 'pw userdel \"${DCCUSER}\"'"
-fi
-exit 0
Index: files/pkg-install.in
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/dcc-dccd/files/pkg-install.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-install.in
--- files/pkg-install.in	31 Jan 2010 03:45:21 -0000	1.1
+++ files/pkg-install.in	2 Jun 2011 21:06:01 -0000
@@ -3,35 +3,9 @@
 
 PREFIX=${PKG_PREFIX:-%%PREFIX%%}
 
-DCCUSER=%%DCCUSER%%
-DCCUID=%%DCCUID%%
-DCCGROUP=%%DCCGROUP%%
-DCCGID=%%DCCGID%%
 DCCHOME=%%DCCHOME%%
 
-if [ "$2" = "PRE-INSTALL" ]; then
-
-	if ! pw groupshow "$DCCGROUP" 2>/dev/null 1>&2; then
-		if pw groupadd $DCCGROUP -g $DCCGID; then
-			echo "=> Added group \"$DCCGROUP\"."
-		else
-			echo "=> Adding group \"$DCCGROUP\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ! pw usershow "$DCCUSER" 2>/dev/null 1>&2; then
-		if pw useradd $DCCUSER -u $DCCUID -g $DCCGROUP -h - \
-			-s "/sbin/nologin" -d "$DCCHOME" \
-			-c "Distributed Checksum Clearinghouse"; \
-		then
-			echo "=> Added user \"$DCCUSER\"."
-		else
-			echo "=> Adding user \"$DCCUSER\" failed..."
-			exit 1
-		fi
-	fi
-elif [ "$2" = "POST-INSTALL" ]; then
+if [ "$2" = "POST-INSTALL" ]; then
 
 	echo "=> Generating unique passwords for your DCC install..."
 	echo "=>"
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-04 13:10:20 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

pgollucci@ wants his PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-04 13:10:23 UTC
Maintainer of mail/dcc-dccd,

Please note that PR ports/157608 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157608

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-04 13:10:25 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Chris Rees freebsd_committer freebsd_triage 2011-06-22 17:54:27 UTC
Responsible Changed
From-To: pgollucci->crees

Invalid autoassignment
Comment 5 Chris Rees freebsd_committer freebsd_triage 2011-06-22 18:02:38 UTC
Responsible Changed
From-To: crees->freebsd-ports-bugs

To pool to correct assign message
Comment 6 Chris Rees freebsd_committer freebsd_triage 2011-06-22 18:24:59 UTC
Responsible Changed
From-To: freebsd-ports-bugs->crees

Invalid autoassignment to pgollucci
Comment 7 Craig Green 2011-06-22 18:45:43 UTC
Apologies; the initial note got buried in email after a vacation and I 
never saw it.

Looking over the patch, it doesn't appear to be doing anything it 
shouldn't, just cleanly excising the old user and group creation code. 
Testing on a couple of boxes shows that the user and group still get 
created successfully with the changes.

As such, I'll gladly approve the patch.


I very much appreciate the time you took to make it.


Cheers and regards,

Craig Green.
------------
Comment 8 Chris Rees freebsd_committer freebsd_triage 2011-06-22 19:39:41 UTC
State Changed
From-To: feedback->open

Maintainer has approved.
Comment 9 Chris Rees freebsd_committer freebsd_triage 2011-07-04 20:39:56 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 10 dfilter service freebsd_committer freebsd_triage 2011-07-04 20:39:59 UTC
crees       2011-07-04 19:39:45 UTC

  FreeBSD ports repository

  Modified files:
    mail/dcc-dccd        Makefile 
    mail/dcc-dccd/files  pkg-install.in 
  Removed files:
    mail/dcc-dccd/files  pkg-deinstall.in 
  Log:
  - Use USERS and GROUPS
  
  PR:             ports/157608
  Approved by:    rene (mentor, implicit), Craig Green <cgreen@sentex.net> (maintainer)
  
  Revision  Changes    Path
  1.48      +5 -9      ports/mail/dcc-dccd/Makefile
  1.2       +0 -13     ports/mail/dcc-dccd/files/pkg-deinstall.in (dead)
  1.2       +2 -28     ports/mail/dcc-dccd/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"