From rebum@mail.vx.sk  Mon Jan 29 13:44:08 2007
Return-Path: <rebum@mail.vx.sk>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 6F58D16A408
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Jan 2007 13:44:08 +0000 (UTC)
	(envelope-from rebum@mail.vx.sk)
Received: from mail.vx.sk (neo.vx.sk [88.198.35.14])
	by mx1.freebsd.org (Postfix) with ESMTP id E52FF13C4A6
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Jan 2007 13:44:07 +0000 (UTC)
	(envelope-from rebum@mail.vx.sk)
Received: from localhost (localhost [127.0.0.1])
	by mail.vx.sk (Postfix) with ESMTP id CE2483F431
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Jan 2007 14:44:06 +0100 (CET)
Received: from mail.vx.sk ([127.0.0.1])
	by localhost (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id hAFx8bwE0jnk for <FreeBSD-gnats-submit@freebsd.org>;
	Mon, 29 Jan 2007 14:43:55 +0100 (CET)
Received: by mail.vx.sk (Postfix, from userid 1001)
	id B46093F455; Mon, 29 Jan 2007 14:43:55 +0100 (CET)
Message-Id: <20070129134355.B46093F455@mail.vx.sk>
Date: Mon, 29 Jan 2007 14:43:55 +0100 (CET)
From: Martin Matuska <martin@matuska.org>
Reply-To:
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PROPOSAL] Automatic registering of UID and GID (bsd.port.mk)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         108514
>Category:       ports
>Synopsis:       [feature request] Automatic registering of UID and GID (bsd.port.mk)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 29 13:50:14 GMT 2007
>Closed-Date:    Sun Sep 06 21:19:35 UTC 2009
>Last-Modified:  Sun Sep  6 21:20:01 UTC 2009
>Originator:     Martin Matuska
>Release:        FreeBSD 6.2-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD 6.2-RELEASE amd64
>Description:
The FreeBSD Project ideas list looks for a framework for adding users/groups
to the system automatically. 

See the following URL:
http://www.freebsd.org/projects/ideas/#p-ports-uid

The patch included contains a working proposal how this framework might look like.

The main problem is to make this work with the package system -
a pre-install (or post-install) script has to be included when
creating a package with pkg_create. But the port maintainer still needs the ability
to supply his own pkg-install and pkg-deinstall scripts. 

This proposal uses the POST-INSTALL (-I) and POST-DEINSTALL (-K) features 
of pkg_create, so that two scripts can be included. This solution makes the POST_INSTALL
and POST_DEINSTALL parts of the existing pkg-install scripts not work (this does always 
apply only if ADDUSER and ADDGROUP is defined)

The question is if it is desired to have users and groups created before or after install.

There are two more approaches I considered:

1. Merging scripts
PROBLEM: impossible if /bin/sh is not used as interpreter for pkg-install or pkg-deinstall

2. Separate includable script by pkg_create
PROBLEM: no backwards compatibility with earlier freebsd versions, 
	 requires a major change to the pkg_install system
		
>How-To-Repeat:
>Fix:
--- bsd.port.mk.orig	Fri Jan 26 11:53:11 2007
+++ bsd.port.mk	Mon Jan 29 14:20:23 2007
@@ -490,6 +490,44 @@
 ##
 # USE_APACHE	- If set, this port relies on an apache webserver.
 #
+##
+#
+# Add required user and group entries on install. Use if your port needs user and group entries.
+# Uses existing groups/users, if available (does not overwrite). Groups are created before users.
+#
+# Group entries
+#
+# ADDGROUP			- A list of group names to be added to the system on port
+#				  or package install. Existing groups will not be overwritten.
+#				  Default: not set.
+#
+# The following variables are effective only if [group] is in the ADDGROUP list
+#
+# ADDGROUP_[group]_gid		- gid for [group]
+#				  Default: not set. (= use next gid from pw.conf)
+# ADDGROUP_[group]_members	- members for [group]
+#				  Default: not set.
+#
+# User entries
+#
+# ADDUSER			- A list of user names to be added to the system on port
+#				  or package install. Existing users will not be overwritten.
+#				  Default: not set.
+#
+# The following variables are effective only if [user] is in the ADDUSER list
+#
+# ADDUSER_[user]_uid		- uid for [user]
+#				  Default: not set. (= use next uid from pw.conf)
+# ADDUSER_[user]_group		- group name or gid for [user]
+#				  Default: not set. (= if a group with same name as [user] 
+#				  exists it is used, else uses default gid from pw.conf)
+# ADDUSER_[user]_comment	- comment for [user]
+#				  Default: "Sandbox"
+# ADDUSER_[user]_homedir	- homedir for [user]
+#				  Default: /
+# ADDUSER_[user]_shell		- shell for [user]
+#				  Default: nologin
+#
 # Conflict checking.  Use if your port cannot be installed at the same time as
 # another package.
 #
@@ -1085,11 +1123,13 @@
 MKDIR?=		/bin/mkdir -p
 MKTEMP?=	/usr/bin/mktemp
 MV?=		/bin/mv
+NOLOGIN?=	/usr/sbin/nologin
 OBJCOPY?=	/usr/bin/objcopy
 OBJDUMP?=	/usr/bin/objdump
 PASTE?=		/usr/bin/paste
 PAX?=		/bin/pax
 PRINTF?=	/usr/bin/printf
+PW?=		/usr/sbin/pw
 REALPATH?=	/bin/realpath
 RM?=		/bin/rm
 RMDIR?=		/bin/rmdir
@@ -3675,6 +3715,92 @@
 .endif
 .endif
 
+# Add users and groups
+
+INSTALL_USERGROUP=	${WRKDIR}/.install-usergroup
+DEINSTALL_USERGROUP=	${WRKDIR}/.deinstall-usergroup
+
+.if !target(add-user-group)
+add-user-group:
+.if defined(ADDGROUP) || defined(ADDUSER)
+	@${ECHO_CMD} \#\!${SH} > ${INSTALL_USERGROUP}
+	@${ECHO_CMD} \#\!${SH} > ${DEINSTALL_USERGROUP}
+.endif
+.if defined(ADDGROUP)
+	@${ECHO_CMD} ${ECHO_MSG} \"===\> The port may have added the following group\(s\):\" >> ${DEINSTALL_USERGROUP}
+	@${ECHO_CMD} -n "${ECHO_MSG} " >> ${DEINSTALL_USERGROUP}
+.for _ADDGROUP in ${ADDGROUP}
+	@${ECHO_CMD} ${ECHO_MSG} \"===\>  Checking if group ${_ADDGROUP} exists\" >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} ${PW} groupshow ${_ADDGROUP} \>/dev/null 2\>/dev/null \|\| err=\"1\"  >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} if [ \"$$\{err\}\" != \"1\" ] \; then  >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} ${ECHO_MSG} \"===\> Group ${_ADDGROUP} already exists, using existing\"\; ${TRUE} >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} else >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} -n err=0\; >> ${INSTALL_USERGROUP}
+.if defined(ADDGROUP_${_ADDGROUP}_gid)
+	@${ECHO_CMD} PW_GID=\"-g ${ADDGROUP_${_ADDGROUP}_gid}\" >> ${INSTALL_USERGROUP}
+.endif
+.if defined(ADDGROUP_${_ADDGROUP}_members)
+	@${ECHO_CMD} PW_MEMBERS=\"-M ${ADDGROUP_${_ADDGROUP}_members}\" >> ${INSTALL_USERGROUP}
+.endif
+	@${ECHO_CMD} ${PW} groupadd ${_ADDGROUP} -q \$${PW_GID} \$${PW_MEMBERS} \|\| err="1" >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} if [ \"$$\{err\}\" = \"1\" ] \; then >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} ${ECHO_MSG} \"Error: Could not add group ${_ADDGROUP}\"\; ${FALSE} >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} else >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} ${ECHO_MSG} \"===\> Added group ${_ADDGROUP}\"\; ${ECHO_MSG} \`${PW} groupshow ${_ADDGROUP}\` >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} fi\; fi >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} -n "${_ADDGROUP} " >> ${DEINSTALL_USERGROUP}
+.endfor
+	@${ECHO_CMD} >> ${DEINSTALL_USERGROUP}
+.endif
+.if defined(ADDUSER)
+	@${ECHO_CMD} ${ECHO_MSG} \"===\> The port may have added the following user\(s\):\" >> ${DEINSTALL_USERGROUP}
+	@${ECHO_CMD} -n "${ECHO_MSG} " >> ${DEINSTALL_USERGROUP}
+.for _ADDUSER in ${ADDUSER}
+	@${ECHO_CMD} ${ECHO_MSG} \"===\>  Checking if user ${_ADDUSER} exists\" >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} ${PW} usershow ${_ADDUSER} \>/dev/null 2\>/dev/null \|\| err=\"1\" >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} if [ \"$$\{err\}\" != \"1\" ] \; then >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} ${ECHO_MSG} \"===\> User ${_ADDUSER} already exists, using existing\"\; err=0\; ${TRUE} >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} else err=0\;>> ${INSTALL_USERGROUP}
+.if defined(ADDUSER_${_ADDUSER}_uid)
+	@${ECHO_CMD} PW_UID=\"-u ${ADDUSER_${_ADDUSER}_uid}\" >> ${INSTALL_USERGROUP}
+.endif
+.if defined(ADDUSER_${_ADDUSER}_group)
+	@${ECHO_CMD} PW_GROUP=\"-g ${ADDUSER_${_ADDUSER}_group}\" >> ${INSTALL_USERGROUP}
+.else
+	@${ECHO_CMD} ${PW} groupshow ${_ADDUSER} \>/dev/null 2\>/dev/null || err=\"1\"; >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} if [ \"$$\{err\}\" != \"1\" ] \; then >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} PW_GROUP=\"-g ${_ADDUSER}\"\; fi\; err=0\; >> ${INSTALL_USERGROUP}
+.endif
+.if defined(ADDUSER_${_ADDUSER}_comment)
+	@${ECHO_CMD} PW_COMMENT=\"${ADDUSER_${_ADDUSER}_comment}\" >> ${INSTALL_USERGROUP}
+.else
+	@${ECHO_CMD} PW_COMMENT=\"Sandbox\" >> ${INSTALL_USERGROUP}
+.endif
+.if defined(ADDUSER_${_ADDUSER}_homedir)
+	@${ECHO_CMD} PW_HOMEDIR=\"${ADDUSER_${_ADDUSER}_homedir}\" >> ${INSTALL_USERGROUP}
+.else
+	@${ECHO_CMD} PW_HOMEDIR=\"/\" >> ${INSTALL_USERGROUP}
+.endif
+.if defined(ADDUSER_${_ADDUSER}_shell)
+	@${ECHO_CMD} PW_SHELL=\"${ADDUSER_${_ADDUSER}_shell}\" >> ${INSTALL_USERGROUP}
+.else
+	@${ECHO_CMD} PW_SHELL=\"${NOLOGIN}\" >> ${INSTALL_USERGROUP}
+.endif
+	@${ECHO_CMD} ${PW} useradd ${_ADDUSER} -q \$${PW_UID} \$${PW_GROUP} -c \"\$${PW_COMMENT}\" -d \"\$${PW_HOMEDIR}\" -s \"\$${PW_SHELL}\" \|\| err=\"1\" >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} if [ \"\$$\{err\}\" = \"1\" ] \; then >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} ${ECHO_MSG} "Error: Could not add user ${_ADDUSER}"\; err=0\; ${FALSE} >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} else >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} ${ECHO_MSG} \"===\> Added user ${_ADDUSER}\"\; ${ECHO_MSG} \`${PW} usershow ${_ADDUSER}\` >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} fi\; fi >> ${INSTALL_USERGROUP}
+	@${ECHO_CMD} -n "${_ADDUSER} " >> ${DEINSTALL_USERGROUP}
+.endfor
+	@${ECHO_CMD} >> ${DEINSTALL_USERGROUP}
+.endif
+.if defined(ADDGROUP) || defined(ADDUSER)
+	@${SH} ${INSTALL_USERGROUP}
+.endif
+.endif
+
 # Package
 
 .if !target(do-package)
@@ -3695,6 +3821,12 @@
 	if [ -f ${PKGDEINSTALL} ]; then \
 		_LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -k ${PKGDEINSTALL}"; \
 	fi; \
+	if [ -f ${INSTALL_USERGROUP} ]; then \
+		_LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -I ${INSTALL_USERGROUP}"; \
+	fi; \
+	if [ -f ${DEINSTALL_USERGROUP} ]; then \
+		_LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -K ${DEINSTALL_USERGROUP}"; \
+	fi; \
 	if [ -f ${PKGREQ} ]; then \
 		_LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -r ${PKGREQ}"; \
 	fi; \
@@ -4144,8 +4276,9 @@
 _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
 				pre-su-install-script do-install install-desktop-entries \
 				post-install post-install-script add-plist-info \
-				add-plist-docs add-plist-post install-rc-script compress-man \
-				install-ldconfig-file fake-pkg security-check
+				add-plist-docs add-plist-post \
+				add-user-group install-rc-script \
+				compress-man install-ldconfig-file fake-pkg security-check
 _PACKAGE_DEP=	install
 _PACKAGE_SEQ=	package-message pre-package pre-package-script \
 				do-package post-package-script
@@ -5622,8 +5755,14 @@
 		if [ -f ${PKGINSTALL} ]; then \
 			${CP} ${PKGINSTALL} ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \
 		fi; \
+		if [ -f ${INSTALL_USERGROUP} ]; then \
+			${CP} ${INSTALL_USERGROUP} ${PKG_DBDIR}/${PKGNAME}/+POST-INSTALL; \
+		fi; \
 		if [ -f ${PKGDEINSTALL} ]; then \
 			${CP} ${PKGDEINSTALL} ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \
+		fi; \
+		if [ -f ${DEINSTALL_USERGROUP} ]; then \
+			${CP} ${DEINSTALL_USERGROUP} ${PKG_DBDIR}/${PKGNAME}/+POST-DEINSTALL; \
 		fi; \
 		if [ -f ${PKGREQ} ]; then \
 			${CP} ${PKGREQ} ${PKG_DBDIR}/${PKGNAME}/+REQUIRE; \
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jan 29 13:50:27 UTC 2007 
Responsible-Changed-Why:  
bsd.port.mk is port manager territory 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108514 

From: Florent Thoumie <flz@xbsd.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/108514
Date: Fri, 02 Feb 2007 14:54:08 +0000

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enig191AC04152E85A606FFC0976
 Content-Type: text/plain; charset=ISO-8859-15
 Content-Transfer-Encoding: quoted-printable
 
 @portmgr: please don't include this patch in the next exp-build as I'd
 like to propose another candidate for this feature.
 
 @submitter: I have another version of the feature you're talking about
 which I think is a bit more elegant (but then again it's my patch
 so...). It currently does the same thing but I'd like to include one or
 two features before submitting it.
 
 --=20
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer
 
 
 --------------enig191AC04152E85A606FFC0976
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.5 (FreeBSD)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFFw1CUMxEkbVFH3PQRCpwoAJ0YA2Sg3VgWet64F25q3sbQgUOA/QCfXQbX
 KVuSwMy9NZeqjzrtdNcukZM=
 =/7Tw
 -----END PGP SIGNATURE-----
 
 --------------enig191AC04152E85A606FFC0976--
State-Changed-From-To: open->suspended 
State-Changed-By: linimon 
State-Changed-When: Fri Feb 2 18:08:59 UTC 2007 
State-Changed-Why:  
flz has stated that he is working on a patch that has similar functionality. 
We'll wait to take a look at both of them together. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108514 

From: Gabor Kovesdan <gabor@FreeBSD.org>
To: bug-followup@FreeBSD.org,  martin@matuska.org
Cc: Florent Thoumie <flz@freebsd.org>
Subject: Re: ports/108514: [PROPOSAL] Automatic registering of UID and GID
 (bsd.port.mk)
Date: Fri, 02 Mar 2007 08:55:50 +0100

 I also thought of how this could be implemented but I had no time to 
 work on it. (I have to finish DESTDIR first.) I thought of the following 
 knobs in port Makefiles:
 
 USE_UID=   6667:irc 6668:ircbot
 
 This example uses the uid 6667 with username irc and uid 6668 with 
 username ircbot.
 
 USE_UID=   auto:foobar
 
 This example uses the first available uid with username foobar.
 And I mean the same for groups with USE_GID Imho, this would be cleaner 
 and more convenient in the port Makefiles and we could use the 
 ADDGROUP_[group]_gid or such internally in bsd.port.mk for the actual 
 implementation. What do you think?
 
 Regards,
 Gabor

From: Pav Lucistnik <pav@FreeBSD.org>
To: bug-followup@FreeBSD.org, gabor@FreeBSD.org
Cc:  
Subject: Re: ports/108514: [PROPOSAL] Automatic registering of UID and GID
	(bsd.port.mk)
Date: Fri, 02 Mar 2007 10:31:57 +0100

 How do you specify homedir, shell, fullname with your USE_UID, gabor?
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 I cannot be responsible for future messages as apparently my cats have
 learned to type.

From: Gabor Kovesdan <gabor@FreeBSD.org>
To: pav@FreeBSD.org
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/108514: [PROPOSAL] Automatic registering of UID and GID
 (bsd.port.mk)
Date: Fri, 02 Mar 2007 12:18:51 +0100

 Pav Lucistnik escribi:
 > How do you specify homedir, shell, fullname with your USE_UID, gabor?
 >
 >   
 Ah yes, what about 6667:irc:/nonexistent:/usr/sbin/nologin ? And auto 
 would be nice here, too. As for fullname, I don't think it makes too 
 much sense.
 
 Gabor

From: Florent Thoumie <flz@xbsd.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/108514
Date: Tue, 10 Apr 2007 15:47:32 +0100

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enig3CDBF41B0217BAC5D7133D41
 Content-Type: text/plain; charset=ISO-8859-15
 Content-Transfer-Encoding: quoted-printable
 
 Here's my version of the patch:
 
 http://people.freebsd.org/~flz/local/ports/users-groups-bpm-v2.diff
 
 Use it like this:
 
 USERS=3D foo bar
 GROUPS=3D blah
 
 You can override the UIDs/GIDs files on a per-port basis by setting
 USERSFILE/GROUPSFILE. You can add usernames in the fourth field of
 GROUPSFILE to automatically put a user in a given group when it's
 created. It seemed like a useful feature to me, if it's not then I'll
 just remove it.
 
 I said something about an offset feature (ie. PORTS_OFFSET_UID set to
 1000 will created users with uid=3D1000+<value_in_UIDs_file>, same for
 GIDs) but it hasn't been implemented yet. Same here, if you think it's
 useful, give me a shout. It won't be long to add support for those.
 
 --=20
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer
 
 
 --------------enig3CDBF41B0217BAC5D7133D41
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.7 (FreeBSD)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFGG6ORMxEkbVFH3PQRCmQ5AJ4oqOB7kNWoQ0LFYDwUlHeQe3rvQgCdG93o
 TtKpbat2hpf5/qpLOTAIQ1k=
 =/kga
 -----END PGP SIGNATURE-----
 
 --------------enig3CDBF41B0217BAC5D7133D41--

From: Florent Thoumie <flz@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc: mm@FreeBSD.org
Subject: Re: ports/108514
Date: Wed, 11 Apr 2007 14:30:28 +0100

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enig66A513313EBC7B607489F081
 Content-Type: text/plain; charset=ISO-8859-15
 Content-Transfer-Encoding: quoted-printable
 
 Florent Thoumie wrote:
 > Here's my version of the patch:
 >=20
 > http://people.freebsd.org/~flz/local/ports/users-groups-bpm-v2.diff
 
 Updated version:
 
 http://people.freebsd.org/~flz/local/ports/users-groups-bpm-v3.diff
 
 USERSFILE/GROUPSFILE have been renamed to UID_FILES/GID_FILES as
 proposed by simon@. You can specify a list of files to be searched for
 users/groups. Common use will be to create a new file somewhere (say
 /etc/UIDs), put some values there to override /usr/ports/UIDs and set
 UID_FILES=3D"/etc/UIDs ${PORTSDIR}/UIDs" in /etc/make.conf.
 
 I've added the offset feature, which is not documented, I hope nobody
 will use it that way :-) If you know what you're doing, set UID_OFFSET
 and/or GID_OFFSET and hope for the best (I've made minimal testing and
 it seems to work just fine).
 
 This new patch also fixes install from packages (few 'if's instead of
 'done's).
 
 --=20
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer
 
 
 --------------enig66A513313EBC7B607489F081
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.7 (FreeBSD)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFGHOL5MxEkbVFH3PQRCjCJAJ9IGQTH8qhkcN/KKoq6Dcxki1BDzgCfZ2/y
 BbL9ZlYAVVqL+aC8bUD5D6o=
 =ebGC
 -----END PGP SIGNATURE-----
 
 --------------enig66A513313EBC7B607489F081--
State-Changed-From-To: suspended->feedback 
State-Changed-By: linimon 
State-Changed-When: Fri May 25 03:55:13 UTC 2007 
State-Changed-Why:  
This seems fairly complicated.  Perhaps there is a way to revisit this 
and still refactor code out of the various ports? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108514 
State-Changed-From-To: feedback->suspended 
State-Changed-By: linimon 
State-Changed-When: Sun Mar 2 06:35:58 UTC 2008 
State-Changed-Why:  
Mark suspended awaiting patches. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108514 

From: "Florent Thoumie" <flz@xbsd.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/108514
Date: Fri, 7 Mar 2008 20:55:58 +0000

 Discussed on IRC with Pav a couple days ago and he'd like to get a
 patch with some ports converted to use these new variables.
 
 -- 
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer

From: "Florent Thoumie" <flz@xbsd.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/108514: [PROPOSAL] Automatic registering of UID and GID (bsd.port.mk)
Date: Mon, 19 May 2008 16:20:47 +0100

 Here's an updated diff with a few ports converted to USERS/GROUPS:
 
 http://people.freebsd.org/~flz/local/ports/users-groups-bpm-v4.diff
 
 Note that users/groups are removed at deinstall time.
 
 -- 
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer

From: "Florent Thoumie" <flz@xbsd.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/108514: [PROPOSAL] Automatic registering of UID and GID (bsd.port.mk)
Date: Tue, 20 May 2008 13:53:16 +0100

 Updated diff after the ports/UIDs format change:
 
 http://people.freebsd.org/~flz/local/ports/users-groups-bpm-v5.diff
 
 -- 
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer

From: "Florent Thoumie" <flz@xbsd.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/108514: [PROPOSAL] Automatic registering of UID and GID (bsd.port.mk)
Date: Thu, 22 May 2008 14:15:53 +0100

 With the current patch, users and groups are unconditionally removed
 at deinstall time, which is problem when more than one port require a
 certain user/group. The solution would be to have a refcount for
 users/groups.
 
 This can be implemented by:
 
 - adding a new @comment entry in the packing list and testing with
 wc(1) at deinstall time.
 - adding a new @user/@group entry (support needed in pkg_install), but
 this means it can't be used before we de-support all FreeBSD versions
 shipping pkg_install without support for those two new keywords.
 - adding a new file (+UGIDS, or something else), but the remark from
 the point above still applies.
 
 This first solution is easy but pretty slow (will block on wc(1) for a
 few seconds for each user/group to be removed).
 The second solution is annoying (because it needs code and won't be
 usable for the next two years) and slow (cause it needs to parse
 +CONTENTS for all packages as well).
 The third solution is a bit less annoying (cause it still needs code),
 but much faster (cause +UGIDS won't exist for most packages or will be
 very small).
 
 The even easier solution, would be not to remove those users/groups.
 
 Comments?
 
 -- 
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer

From: =?ISO-8859-15?Q?Dorian_B=FCttner?= <dorian.buettner@gmx.de>
To: bug-followup@FreeBSD.org, martin@matuska.org
Cc:  
Subject: Re: ports/108514: [PROPOSAL] Automatic registering of UID and GID
 (bsd.port.mk)
Date: Sun, 21 Sep 2008 22:25:03 +0200

 Hi folks,
 
 just was sitting here browsing open PRs, and I was wondering what you 
 would think of this one:
 http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/125330
 To cut a long story short, if you delete a user from the passwd-backend 
 it remains in the nscd-cache for a while. This is not so good for 
 automated updates of ports.
 Is it something your new automatism could take care of?
 
 Thanks,
 Dorian

From: "Florent Thoumie" <flz@xbsd.org>
To: "=?ISO-8859-1?Q?Dorian_B=FCttner?=" <dorian.buettner@gmx.de>
Cc: portmgr@freebsd.org, bug-followup@freebsd.org
Subject: Re: ports/108514: [PROPOSAL] Automatic registering of UID and GID (bsd.port.mk)
Date: Mon, 22 Sep 2008 10:22:44 +0100

 On Mon, Sep 22, 2008 at 12:00 AM, Dorian B=FCttner <dorian.buettner@gmx.de>=
  wrote:
 
 >  Hi folks,
 >
 >  just was sitting here browsing open PRs, and I was wondering what you
 >  would think of this one:
 >  http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/125330
 >  To cut a long story short, if you delete a user from the passwd-backend
 >  it remains in the nscd-cache for a while. This is not so good for
 >  automated updates of ports.
 >  Is it something your new automatism could take care of?
 
 No it's not something I've taken into account, but it's definitely a
 good idea to flush the cache.
 
 I still haven't decided what way to solve the issue I'm facing, should
 really get this done soon but I'm busy with something else these days.
 
 --=20
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer
State-Changed-From-To: suspended->closed 
State-Changed-By: flz 
State-Changed-When: Sun Sep 6 21:19:34 UTC 2009 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108514 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/108514: commit references a PR
Date: Sun,  6 Sep 2009 21:18:58 +0000 (UTC)

 flz         2009-09-06 21:18:50 UTC
 
   FreeBSD ports repository
 
   Modified files:
     Mk                   bsd.port.mk 
     audio/pulseaudio     Makefile 
     devel/dbus           Makefile pkg-install 
     sysutils/hal         Makefile 
     sysutils/hal/files   pkg-install.in 
     sysutils/policykit   Makefile pkg-install 
     x11/gdm              Makefile pkg-install 
   Removed files:
     audio/pulseaudio     pkg-install 
   Log:
   Add support to create users and groups from information stored in UIDs/GIDs
   files. Users and groups won't be deleted at deinstall time as we're lacking
   a refcount to know if any port is using them.
   
   Also convert a few ports while I'm here.
   
   PR:             ports/108514
   Submitted by:   mm, self
   
   Revision  Changes    Path
   1.627     +89 -3     ports/Mk/bsd.port.mk
   1.48      +4 -4      ports/audio/pulseaudio/Makefile
   1.6       +0 -63     ports/audio/pulseaudio/pkg-install (dead)
   1.76      +4 -1      ports/devel/dbus/Makefile
   1.6       +0 -27     ports/devel/dbus/pkg-install
   1.58      +4 -1      ports/sysutils/hal/Makefile
   1.5       +0 -27     ports/sysutils/hal/files/pkg-install.in
   1.20      +4 -1      ports/sysutils/policykit/Makefile
   1.6       +0 -27     ports/sysutils/policykit/pkg-install
   1.124     +4 -1      ports/x11/gdm/Makefile
   1.15      +0 -30     ports/x11/gdm/pkg-install
 _______________________________________________
 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"
 
>Unformatted:
