From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jan 28 11:40:07 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 79382106566C for ; Sat, 28 Jan 2012 11:40:07 +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 4F9E88FC1A for ; Sat, 28 Jan 2012 11:40:07 +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 q0SBe7BS095387 for ; Sat, 28 Jan 2012 11:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0SBe7xp095386; Sat, 28 Jan 2012 11:40:07 GMT (envelope-from gnats) Resent-Date: Sat, 28 Jan 2012 11:40:07 GMT Resent-Message-Id: <201201281140.q0SBe7xp095386@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 D1576106566B for ; Sat, 28 Jan 2012 11:32:39 +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 B622C8FC08 for ; Sat, 28 Jan 2012 11:32:39 +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 q0SBWd7K091657 for ; Sat, 28 Jan 2012 11:32:39 GMT (envelope-from crees@freefall.freebsd.org) Received: (from crees@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0SBWdO5091656; Sat, 28 Jan 2012 11:32:39 GMT (envelope-from crees) Message-Id: <201201281132.q0SBWdO5091656@freefall.freebsd.org> Date: Sat, 28 Jan 2012 11:32:39 GMT From: Chris Rees To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/164568: [PATCH] sysutils/bacula-server shouldn't use pkg-install to create 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: Sat, 28 Jan 2012 11:40:07 -0000 >Number: 164568 >Category: ports >Synopsis: [PATCH] sysutils/bacula-server shouldn't use pkg-install to create 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 Jan 28 11:40:06 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: bacula-server uses pkg-install scripts to create users on installation, and should use the USERS hooks in bsd.port.mk. It also should not set DEFAULT_PGSQL_VER. >How-To-Repeat: >Fix: --- patch.txt begins here --- Index: Makefile =================================================================== RCS file: /home/pcvs/ports/sysutils/bacula-server/Makefile,v retrieving revision 1.132 diff -u -r1.132 Makefile --- Makefile 15 Jan 2012 22:35:00 -0000 1.132 +++ Makefile 28 Jan 2012 11:30:15 -0000 @@ -17,6 +17,9 @@ UNIQUENAME?= ${PORTNAME}${PKGNAMESUFFIX} +USERS= bacula +GROUPS= ${USERS} + PLIST_SUB+= MAJOR=${PORTVERSION:R:R} USE_GMAKE= yes @@ -161,7 +164,6 @@ LIB_DEPENDS+= sqlite3:${PORTSDIR}/databases/sqlite3 DBTYPE= sqlite3 .else -DEFAULT_PGSQL_VER?= 83 USE_PGSQL= yes CONFIGURE_ARGS+= --with-postgresql=yes DBTYPE= postgresql Index: files/pkg-install.client.in =================================================================== RCS file: /home/pcvs/ports/sysutils/bacula-server/files/pkg-install.client.in,v retrieving revision 1.3 diff -u -r1.3 pkg-install.client.in --- files/pkg-install.client.in 7 Sep 2010 16:21:42 -0000 1.3 +++ files/pkg-install.client.in 28 Jan 2012 11:30:15 -0000 @@ -2,14 +2,6 @@ PATH=/bin:/usr/bin:/usr/sbin -# Install UID/GID -USER=%%BACULA_USER%% -GROUP=%%BACULA_GROUP%% -UID=%%BACULA_UID%% -GID=%%BACULA_UID%% -BACULA_DIR=%%BACULA_DIR%% - - # Always add lines in /etc/services grep -q "bacula-dir" /etc/services if [ "$?" != "0" ]; then @@ -19,24 +11,3 @@ bacula-sd 9103/tcp #Bacula storage daemon # Bacule port end" >> /etc/services fi - -case $2 in -PRE-INSTALL) - if [ ! -d ${BACULA_DIR} ]; then - mkdir -p ${BACULA_DIR} - fi - - 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 - - chgrp -R ${GROUP} ${BACULA_DIR} - ;; -esac Index: files/pkg-install.server.in =================================================================== RCS file: /home/pcvs/ports/sysutils/bacula-server/files/pkg-install.server.in,v retrieving revision 1.2 diff -u -r1.2 pkg-install.server.in --- files/pkg-install.server.in 7 Sep 2010 16:21:42 -0000 1.2 +++ files/pkg-install.server.in 28 Jan 2012 11:30:15 -0000 @@ -2,13 +2,6 @@ PATH=/bin:/usr/bin:/usr/sbin -# Install UID/GID -USER=%%BACULA_USER%% -GROUP=%%BACULA_GROUP%% -UID=%%BACULA_UID%% -GID=%%BACULA_UID%% -BACULA_DIR=%%BACULA_DIR%% - # Always add lines in /etc/services grep -q "bacula-dir" /etc/services if [ "$?" != "0" ]; then @@ -18,43 +11,3 @@ bacula-sd 9103/tcp #Bacula storage daemon # Bacule port end" >> /etc/services fi - -case $2 in -PRE-INSTALL) - if [ ! -d ${BACULA_DIR} ]; then - mkdir -p ${BACULA_DIR} - fi - - 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." - if pw usermod ${USER} -d ${BACULA_DIR} -G operator - then - echo "Changed home directory of \"${USER}\" to \"${BACULA_DIR}\"" - else - echo "Changing home directory of \"${USER}\" to \"${BACULA_DIR}\" failed..." - exit 1 - fi - else - if pw useradd ${USER} -u ${UID} -g ${GROUP} -G operator -h - \ - -d ${BACULA_DIR} -s /sbin/nologin -c "Bacula Daemon" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi - chown -R ${USER}:${GROUP} ${BACULA_DIR} - ;; -esac --- patch.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted: