From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Jan 15 20:50:13 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72B01065677 for ; Sun, 15 Jan 2012 20:50:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BE8EF8FC21 for ; Sun, 15 Jan 2012 20:50:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0FKoD2T029213 for ; Sun, 15 Jan 2012 20:50:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0FKoD1c029211; Sun, 15 Jan 2012 20:50:13 GMT (envelope-from gnats) Resent-Date: Sun, 15 Jan 2012 20:50:13 GMT Resent-Message-Id: <201201152050.q0FKoD1c029211@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Chris Rees Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D49751065673 for ; Sun, 15 Jan 2012 20:49:19 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BF1A68FC23 for ; Sun, 15 Jan 2012 20:49:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0FKnJjH029043 for ; Sun, 15 Jan 2012 20:49:19 GMT (envelope-from crees@freefall.freebsd.org) Received: (from crees@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0FKnJpT029042; Sun, 15 Jan 2012 20:49:19 GMT (envelope-from crees) Message-Id: <201201152049.q0FKnJpT029042@freefall.freebsd.org> Date: Sun, 15 Jan 2012 20:49:19 GMT From: Chris Rees To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/164187: [PATCH] net/avahi etc should use USERS X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Chris Rees List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 20:50:14 -0000 >Number: 164187 >Category: ports >Synopsis: [PATCH] net/avahi etc 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: Sun Jan 15 20:50:13 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Chris Rees >Release: FreeBSD 8.2-STABLE i386 >Organization: >Environment: System: FreeBSD freefall.freebsd.org 8.2-STABLE FreeBSD 8.2-STABLE #5 r227907: Wed Nov 23 21:55:50 UTC 2011 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386 >Description: The avahi ports use a pkg-install script to create users and groups, which is old-fashioned :) Attached patch removes the pkg-install scripts (including one that is never used), adds the users to UIDs and modernises that part of the Makefile Let me know if you'd like patches to the MCom repo too! >How-To-Repeat: >Fix: --- avahi-users.diff begins here --- Index: UIDs =================================================================== RCS file: /home/pcvs/ports/UIDs,v retrieving revision 1.182 diff -u -r1.182 UIDs --- UIDs 19 Nov 2011 07:05:21 -0000 1.182 +++ UIDs 15 Jan 2012 20:46:41 -0000 @@ -169,6 +169,7 @@ polkit:*:562:562::0:0:PolicyKit User:/nonexistent:/usr/sbin/nologin pulse:*:563:563::0:0:PulseAudio System User:/nonexistent:/usr/sbin/nologin assp:*:587:587::0:0:ASSP Anti-Spam Proxy:/var/db/assp:/usr/sbin/nologin +avahi-autoipd:*:588:588::0:0:Avahi Autoipd Daemon user:/nonexistent:/usr/sbin/nologin _xsi:*:600:600::0:0:XMLSysInfo User:/nonexistent:/usr/sbin/nologin _tss:*:601:601:daemon:0:0:TrouSerS user:/var/empty:/usr/sbin/nologin _pkcs11:*:602:602:daemon:0:0:opencryptoki user:/var/empty:/usr/sbin/nologin Index: net/avahi-app/Makefile =================================================================== RCS file: /home/pcvs/ports/net/avahi-app/Makefile,v retrieving revision 1.32 diff -u -r1.32 Makefile --- net/avahi-app/Makefile 23 Sep 2011 22:24:24 -0000 1.32 +++ net/avahi-app/Makefile 15 Jan 2012 20:46:41 -0000 @@ -23,6 +23,9 @@ gdbm.4:${PORTSDIR}/databases/gdbm RUN_DEPENDS?= g-ir-scanner:${PORTSDIR}/devel/gobject-introspection +USERS?= ${PORTNAME} +GROUPS?= ${USERS} + USE_GNOME?= gnomehack ltverhack glib20 intltool USE_GETTEXT= yes USE_GNOME_SUBR= yes @@ -168,8 +171,5 @@ ${INSTALL_DATA} ${FILESDIR}/org.freedesktop.Avahi.service \ ${LOCALBASE}/share/dbus-1/system-services .endif -.if !defined(PACKAGE_BUILDING) && (${AVAHI_SLAVE}=="no" || ${AVAHI_SLAVE}=="autoipd") - @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL -.endif .include Index: net/avahi-app/pkg-install =================================================================== RCS file: net/avahi-app/pkg-install diff -N net/avahi-app/pkg-install --- net/avahi-app/pkg-install 24 Oct 2007 23:37:22 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@ -#!/bin/sh - -case $2 in -POST-INSTALL) - USER=avahi - GROUP=${USER} - UID=558 - GID=${UID} - PW=/usr/sbin/pw - - 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 "Avahi Daemon User" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi - exit 0 - ;; -esac Index: net/avahi-autoipd/Makefile =================================================================== RCS file: /home/pcvs/ports/net/avahi-autoipd/Makefile,v retrieving revision 1.6 diff -u -r1.6 Makefile --- net/avahi-autoipd/Makefile 11 Aug 2011 19:19:46 -0000 1.6 +++ net/avahi-autoipd/Makefile 15 Jan 2012 20:46:41 -0000 @@ -15,6 +15,9 @@ LIB_DEPENDS= avahi-common.3:${PORTSDIR}/net/avahi-app +USERS= avahi-autoipd +GROUPS= ${USERS} + MASTERDIR= ${.CURDIR}/../avahi-app BUILD_WRKSRC= ${WRKSRC}/avahi-autoipd INSTALL_WRKSRC= ${BUILD_WRKSRC} @@ -25,6 +28,5 @@ MAN8= avahi-autoipd.8 USE_GNOME= gnomehack ltverhack intltool -PKGINSTALL= ${.CURDIR}/pkg-install .include "${MASTERDIR}/Makefile" Index: net/avahi-autoipd/pkg-install =================================================================== RCS file: net/avahi-autoipd/pkg-install diff -N net/avahi-autoipd/pkg-install --- net/avahi-autoipd/pkg-install 28 Dec 2011 21:01:44 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@ -#!/bin/sh - -case $2 in -POST-INSTALL) - USER=avahi-autoipd - GROUP=${USER} - UID=588 - GID=${UID} - PW=/usr/sbin/pw - - 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 "Avahi Autoipd Daemon User" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi - exit 0 - ;; -esac Index: net/avahi-libdns/pkg-install =================================================================== RCS file: net/avahi-libdns/pkg-install diff -N net/avahi-libdns/pkg-install --- net/avahi-libdns/pkg-install 28 Dec 2011 21:01:44 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@ -#!/bin/sh - -case $2 in -POST-INSTALL) - USER=avahi-autoipd - GROUP=${USER} - UID=588 - GID=${UID} - PW=/usr/sbin/pw - - 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 "Avahi Daemon User" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi - exit 0 - ;; -esac --- avahi-users.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: