Date: Thu, 2 Jun 2011 12:10:48 +0100 From: Chris Rees <utisoft@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/157526: [PATCH] audio/shoutcast creates users manually Message-ID: <BLU0-SMTP138537AA4A7D41F9113FA42A97C0@phx.gbl> Resent-Message-ID: <201106021140.p52Be45U047791@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 157526 >Category: ports >Synopsis: [PATCH] audio/shoutcast creates users manually >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 11:40:03 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=, and also tries to delete users on deinstall without prompting -- this is a problem if another installed port uses that username. >How-To-Repeat: >Fix: - Use USERS and GROUPS - Stop deleting users/groups on deinstall Submitted by: Chris Rees (utisoft@gmail.com) Please note that pkg-install and pkg-deinstall have been removed, and the patch for GIDs from ports/157525 is needed. If this PR is committed first, please leave a note in the audit trail for 157525 to say the GIDs patch is not necessary. --- audio-shoutcast.patch begins here --- Index: Makefile =================================================================== RCS file: /exports/cvsroot-freebsd/ports/audio/shoutcast/Makefile,v retrieving revision 1.16 diff -u -r1.16 Makefile --- Makefile 2 Sep 2010 21:17:32 -0000 1.16 +++ Makefile 2 Jun 2011 09:49:08 -0000 @@ -21,6 +21,8 @@ CONFLICTS= linux-shoutcast-[0-9]* +USERS= ${PORTNAME} +GROUPS= ${USERS} USE_RC_SUBR= shoutcast.sh PORTDOCS= README.TXT WRKSRC= ${WRKDIR} @@ -46,7 +48,4 @@ @${INSTALL_DATA} ${WRKSRC}/README.TXT ${DOCSDIR} .endif -post-install: - @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL - .include <bsd.port.mk> Index: pkg-deinstall =================================================================== RCS file: pkg-deinstall diff -N pkg-deinstall --- pkg-deinstall 5 Jun 2006 10:35:35 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -#!/bin/sh - -if [ "$2" != "POST-DEINSTALL" ]; then - exit 0 -fi - -SC_GROUP=shoutcast -SC_USER=shoutcast -SC_SHELL=/bin/sh -SC_HOME=/nonexistent -PW=/usr/sbin/pw - -pw groupdel shoutcast >/dev/null 2>&1 -pw userdel shoutcast >/dev/null 2>&1 - -exit 0 Index: pkg-install =================================================================== RCS file: pkg-install diff -N pkg-install --- pkg-install 31 Mar 2007 19:56:18 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,50 +0,0 @@ -#!/bin/sh - -if [ "$2" != "POST-INSTALL" ]; then - exit 0 -fi - -SC_GROUP=shoutcast -SC_USER=shoutcast -SC_SHELL=/bin/sh -SC_HOME=/nonexistent -PW="/usr/sbin/pw" - -if ! ${PW} show group ${SC_GROUP} -q >/dev/null; then - gid=210 - while ${PW} show group -g ${gid} -q >/dev/null; do - gid=`expr ${gid} + 1` - done - if ! ${PW} add group ${SC_GROUP} -g ${gid}; then - e=$? - echo "*** Failed to add group \`${SC_GROUP}'. Please add it manually." - exit ${e} - fi - echo "*** Added group \`${SC_GROUP}' (id ${gid})" -else - gid=`${PW} show group ${SC_GROUP} 2>/dev/null | cut -d: -f3` -fi - -if ! ${PW} show user ${SC_USER} -q >/dev/null; then - uid=210 - while ${PW} show user -u ${uid} -q >/dev/null; do - uid=`expr ${uid} + 1` - done - if ! ${PW} add user ${SC_USER} -u ${uid} -g ${gid} -d "${SC_HOME}" \ - -c "Shoutcast sandbox" -s "${SC_SHELL}" -p "*" \ - ; then - e=$? - echo "*** Failed to add user \`${SC_USER}'. Please add it manually." - exit ${e} - fi - echo "*** Added user \`${SC_USER}' (id ${uid})" -else - if ! ${PW} mod user ${SC_USER} -g ${gid} -d "${SC_HOME}" \ - -c "Shoutcast sandbox" -s "${SC_SHELL}" -p "*" \ - ; then - e=$? - echo "*** Failed to update user \`${SC_USER}'." - exit ${e} - fi - echo "*** Updated user \`${SC_USER}'." -fi --- audio-shoutcast.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-SMTP138537AA4A7D41F9113FA42A97C0>