Bug 157665 - Fix port: mail/simscan should use USERS
Summary: Fix port: mail/simscan should use USERS
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Felippe de Meirelles Motta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-06 18:40 UTC by Chris Rees
Modified: 2011-07-10 18:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rees 2011-06-06 18:40:05 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.--2WfBFZQe9KuS2jilKRDxSHIdxugNGjmW8BJT75EhLNcSuVS1
Content-Type: text/plain; name="mail-simscan.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="mail-simscan.patch"

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
+@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
Comment 1 Edwin Groothuis freebsd_committer 2011-06-06 18:40:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lippe

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2011-07-10 18:46:07 UTC
crees       2011-07-10 17:45:53 UTC

  FreeBSD ports repository

  Modified files:
    mail/simscan         Makefile pkg-plist 
    mail/simscan/files   pkg-install.in 
  Removed files:
    mail/simscan/files   pkg-deinstall.in 
  Log:
  Use USERS and GROUPS
  
  PR:             ports/157665
  Submitted by:   crees (me)
  Approved by:    rene (mentor, implicit), maintainer timeout (lippe, 35 days)
  
  Revision  Changes    Path
  1.20      +6 -3      ports/mail/simscan/Makefile
  1.2       +0 -19     ports/mail/simscan/files/pkg-deinstall.in (dead)
  1.2       +2 -33     ports/mail/simscan/files/pkg-install.in
  1.4       +1 -0      ports/mail/simscan/pkg-plist
_______________________________________________
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"
Comment 3 Chris Rees freebsd_committer 2011-07-10 18:53:56 UTC
State Changed
From-To: open->closed

Maintainer timeout, committed.