ports/157665: Fix port: mail/simscan should use USERS

Chris Rees utisoft at gmail.com
Mon Jun 6 17:40:05 UTC 2011


>Number:         157665
>Category:       ports
>Synopsis:       Fix port: mail/simscan should use USERS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 06 17:40:05 UTC 2011
>Closed-Date:
>Last-Modified:
>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 at 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=

>How-To-Repeat:
	
>Fix:

	

	- Use USERS and GROUPS

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

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


--- mail-simscan.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/simscan/Makefile,v
retrieving revision 1.19
diff -u -r1.19 Makefile
--- Makefile	6 Apr 2010 12:01:54 -0000	1.19
+++ Makefile	5 Jun 2011 17:50:39 -0000
@@ -19,15 +19,18 @@
 
 GNU_CONFIGURE=	yes
 
+USERS=		${PORTNAME}
+GROUPS=		${USERS}
+
 WORKDIR?=	${QMAIL_PREFIX}/${PORTNAME}
 QMAIL_QUEUE=	${QMAIL_PREFIX}/bin/qmail-queue
 
 SUB_FILES=	pkg-message \
-		pkg-install \
-		pkg-deinstall
+		pkg-install
 SUB_LIST=	QMAIL_PREFIX=${QMAIL_PREFIX} \
 		SIMSCAN_DIR=${PORTNAME}
-PLIST_SUB=	QMAIL_PREFIX=${QMAIL_PREFIX}
+PLIST_SUB=	QMAIL_PREFIX=${QMAIL_PREFIX} \
+		SIMSCAN_DIR=${PORTNAME}
 
 OPTIONS=	CLAMAV "Support for ClamAV Virus Scanning" on \
 		RIPMIME "Ripmime Processing (if Clamav ScanMail disabled)" on \
Index: pkg-plist
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/simscan/pkg-plist,v
retrieving revision 1.3
diff -u -r1.3 pkg-plist
--- pkg-plist	30 Aug 2007 16:12:16 -0000	1.3
+++ pkg-plist	5 Jun 2011 17:53:29 -0000
@@ -1,3 +1,4 @@
 @cwd %%QMAIL_PREFIX%%
 bin/simscanmk
 bin/simscan
+ at dirrmtry %%SIMSCAN_DIR%%
Index: files/pkg-deinstall.in
===================================================================
RCS file: files/pkg-deinstall.in
diff -N files/pkg-deinstall.in
--- files/pkg-deinstall.in	30 Aug 2007 16:12:16 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/mail/simscan/files/pkg-deinstall.in,v 1.1 2007/08/30 16:12:16 garga Exp $
-
-USER=simscan
-GROUP=${USER}
-
-if [ x$2 != xDEINSTALL ]; then
-    exit
-fi
-
-pw groupdel -n ${GROUP} || true
-pw userdel -n ${GROUP} || true
-
-rmdir %%QMAIL_PREFIX%%/%%SIMSCAN_DIR%% || true
-
-echo ""
-echo "If you're not updating this port, you can delete %%QMAIL_PREFIX%%/%%SIMSCAN_DIR%% directory"
-echo ""
Index: files/pkg-install.in
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/simscan/files/pkg-install.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-install.in
--- files/pkg-install.in	30 Aug 2007 16:12:16 -0000	1.1
+++ files/pkg-install.in	5 Jun 2011 17:45:32 -0000
@@ -4,40 +4,9 @@
 
 USER=simscan
 GROUP=${USER}
-UID=74
-GID=${UID}
 SIMDIR=%%QMAIL_PREFIX%%/%%SIMSCAN_DIR%%
 
-if [ "$2" = "PRE-INSTALL" ]; then
-
-echo adding simscan user
-
-        if pw group show "${GROUP}" 2>/dev/null; then
-                echo "You already have a group \"${GROUP}\", so I will use it."
-        else
-                if pw groupadd ${GROUP} -g ${GID}; then
-                        echo "Added group \"${GROUP}\"."
-                else
-                        echo "Adding group \"${GROUP}\" failed..."
-                        exit 1
-                fi
-        fi
-
-
-        if pw user show "${USER}" 2>/dev/null; then
-                echo "You already have a user \"${USER}\", so I will use it."
-        else
-                if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-                        -d /nonexistent -s /sbin/nologin -c "Simscan User"
-                then
-                        echo "Added user \"${USER}\"."
-                else
-                        echo "Adding user \"${USER}\" failed..."
-                        exit 1
-                fi
-        fi
-
-elif [ "$2" = "POST-INSTALL" ]; then
+if [ "$2" = "POST-INSTALL" ]; then
 
 	if [ ! -d "$SIMDIR" ]; then
 		/bin/mkdir -p "$SIMDIR" || exit 1
--- mail-simscan.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:
>Unformatted:



More information about the freebsd-ports-bugs mailing list