Date: Sat, 4 Jun 2011 09:29:20 +0100 From: Chris Rees <utisoft@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/157576: [PATCH] Fix port: mail/dkfilter should use USERS Message-ID: <BLU0-SMTP1216A4C0A5D177B6479CA59A97E0@phx.gbl> Resent-Message-ID: <201106040830.p548UDi5077093@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 157576 >Category: ports >Synopsis: [PATCH] Fix port: mail/dkfilter 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: Sat Jun 04 08:30:13 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@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@gmail.com) Please bear in mind that files/pkg-install and files/pkg-deinstall.in have been removed. --- mail-dkfilter.patch begins here --- Index: Makefile =================================================================== RCS file: /exports/cvsroot-freebsd/ports/mail/dkfilter/Makefile,v retrieving revision 1.10 diff -u -r1.10 Makefile --- Makefile 27 Jan 2010 13:05:25 -0000 1.10 +++ Makefile 2 Jun 2011 21:31:26 -0000 @@ -24,18 +24,10 @@ USE_PERL5= yes USE_RC_SUBR= dkfilter_in dkfilter_out +USERS= ${DKFILTER_USERNAME} +GROUPS= ${DKFILTER_GROUPNAME} + DKFILTER_USERNAME?= dkfilter -DKFILTER_USERID?= 325 DKFILTER_GROUPNAME?= ${DKFILTER_USERNAME} -DKFILTER_GROUPID?= ${DKFILTER_USERID} - -SUB_FILES= pkg-install pkg-deinstall -SUB_LIST= USER=${DKFILTER_USERNAME} \ - UID=${DKFILTER_USERID} \ - GROUP=${DKFILTER_GROUPNAME} \ - GID=${DKFILTER_GROUPID} - -pre-install: - ${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL .include <bsd.port.mk> Index: files/pkg-deinstall.in =================================================================== RCS file: files/pkg-deinstall.in diff -N files/pkg-deinstall.in --- files/pkg-deinstall.in 29 Jul 2006 02:07:43 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@ -#!/bin/sh -# $FreeBSD: ports/mail/dkfilter/files/pkg-deinstall.in,v 1.1 2006/07/29 02:07:43 rafan Exp $ - -if [ "$2" != "POST-DEINSTALL" ]; then - exit 0 -fi - -USERNAME=%%USER%% - -if pw usershow "${USERNAME}" 2>/dev/null 1>&2; then - echo "To delete ${USERNAME} user permanently, use 'pw userdel \"${USERNAME}\"'" -fi -exit 0 Index: files/pkg-install.in =================================================================== RCS file: files/pkg-install.in diff -N files/pkg-install.in --- files/pkg-install.in 29 Jul 2006 02:07:43 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@ -#! /bin/sh -# -# $FreeBSD: ports/mail/dkfilter/files/pkg-install.in,v 1.1 2006/07/29 02:07:43 rafan Exp $ - -PATH=/bin:/usr/bin:/usr/sbin - -case $2 in - -PRE-INSTALL) - echo "---> Starting install script:" - - if [ -z "%%USER%%" -o -z "%%GROUP%%" -o \ - -z "%%UID%%" -o -z "%%GID%%" ]; then - echo "ERROR: A required pragma was empty" - exit 1 - fi - - # Create group if required - if pw group show "%%GROUP%%" >/dev/null 2>&1; then - echo "---> Using existing group \"%%GROUP%%\"" - else - echo "---> Adding group \"%%GROUP%%\" (%%GID%%)" - /usr/sbin/pw groupadd %%GROUP%% -g %%GID%% || exit 1 - fi - - # Create user if required - if pw user show "%%USER%%" >/dev/null 2>&1; then - echo "---> Using existing user \"%%USER%%\"" - else - echo "---> Adding user \"%%USER%%\" (%%UID%%)" - pw useradd "%%USER%%" -u "%%UID%%" -g "%%GROUP%%" -h - \ - -d "/nonexistent" -s "/sbin/nologin" -c "DK Filter Owner" || exit 1 - fi - ;; - -esac --- mail-dkfilter.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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BLU0-SMTP1216A4C0A5D177B6479CA59A97E0>