ports/157525: [PATCH] audio/linux-shoutcast creates users manually
Chris Rees
utisoft at gmail.com
Thu Jun 2 10:50:08 UTC 2011
>Number: 157525
>Category: ports
>Synopsis: [PATCH] audio/linux-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 10:50:07 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 at 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=.
>How-To-Repeat:
>Fix:
- Use USERS and GROUPS
Submitted by: Chris Rees (utisoft at gmail.com)
Please bear in mind that files/pkg-install.in has been removed
This port also requires a patch to GIDs, at [1].
[1] http://www.bayofrum.net/~crees/patches/uids/audio-shoutcast-gids.patch
--- linux-shoutcast.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/audio/linux-shoutcast/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- Makefile 2 Sep 2010 21:17:32 -0000 1.9
+++ Makefile 1 Jun 2011 09:55:43 -0000
@@ -21,6 +21,8 @@
NO_BUILD= YES
RESTRICTED= Redistribution of the software is not allowed
+USERS= ${PORTNAME}
+GROUPS= ${USERS}
USE_RC_SUBR= shoutcast.sh
PORTDOCS= README.TXT
WRKSRC= ${WRKDIR}
@@ -48,7 +50,6 @@
.endif
post-install:
- @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${BRANDELF} -t Linux ${PREFIX}/sbin/sc_serv
.include <bsd.port.mk>
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install 31 Mar 2007 19:56:18 -0000 1.3
+++ /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
--- linux-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:
More information about the freebsd-ports-bugs
mailing list