Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jun 2011 22:57:38 +0100
From:      Chris Rees <chris@zeus.bayofrum.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/157546: [PATCH] Add feature to bsd.port.mk: Warn on deinstall about groups created by port
Message-ID:  <BLU0-SMTP1399524C590DC4F243114E4A97C0@phx.gbl>
Resent-Message-ID: <201106022200.p52M0L7v012769@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         157546
>Category:       ports
>Synopsis:       [PATCH] Add feature to bsd.port.mk: Warn on deinstall about groups created by port
>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:   Thu Jun 02 22:00:21 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Chris Rees
>Release:        FreeBSD 8.2-RELEASE-p1 i386
>Organization:
>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:
	While working on fixing ports to use USERS people in IRC were wishing that ports warned on deinstall about groups created, just as it does for users.

	The attached patch should have that effect.
>How-To-Repeat:
	
>Fix:

	Warn users on deinstall about GROUPS created by port, as is already done for USERS.

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

--- bsd-port-mk-groups-remove-warn.patch begins here ---
--- bsd.port.mk.orig	2011-06-02 22:40:47.282578549 +0100
+++ bsd.port.mk	2011-06-02 22:46:58.023260860 +0100
@@ -1280,6 +1280,10 @@
 # alpha numeric sort order
 USERS_BLACKLIST=	_dhcp _pflogd bin bind daemon games kmem mailnull man news nobody operator pop proxy root smmsp sshd toor tty uucp www
 
+# predefined accounts from src/etc/group
+# alpha numeric sort order
+GROUPS_BLACKLIST=	_dhcp _pflogd audit authpf bin bind daemon dialer ftp games guest kmem mail mailnull man network news nobody nogroup operator proxy smmsp sshd staff sys tty uucp wheel www
+
 LDCONFIG_DIR=	libdata/ldconfig
 LDCONFIG32_DIR=	libdata/ldconfig32
 
@@ -4267,6 +4271,14 @@
 	fi
 .endfor
 .endif
+.if defined(GROUPS)
+.for _group in ${GROUPS}
+	@if [ ! ${GROUPS_BLACKLIST:M${_group}} ] ; then \
+		${ECHO_CMD} "@unexec if ${PW} groupshow ${_group} >/dev/null 2>&1; then \
+		echo \"==> You should manually remove the \\\"${_group}\\\" group. \"; fi" >> ${TMPPLIST}; \
+	fi
+.endfor
+.endif # defined(GROUPS)
 .endif
 .else
 	@${DO_NADA}
--- bsd-port-mk-groups-remove-warn.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-SMTP1399524C590DC4F243114E4A97C0>