ports/157596: [PATCH] Fix port: japanese/tiarra should use USERS
Chris Rees
utisoft at gmail.com
Sat Jun 4 10:20:11 UTC 2011
>Number: 157596
>Category: ports
>Synopsis: [PATCH] Fix port: japanese/tiarra 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: Sat Jun 04 10:20: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 note that files/pkg-install.in and files/pkg-deinstall.in have been removed.
--- japanese-tiarra.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/japanese/tiarra/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile 9 Aug 2010 08:54:34 -0000 1.7
+++ Makefile 2 Jun 2011 20:30:23 -0000
@@ -21,9 +21,10 @@
USE_RC_SUBR= tiarra
NO_BUILD= yes
-SUB_FILES= pkg-install pkg-deinstall pkg-message
-SUB_LIST= TIARRA_USER=${TIARRA_USER} \
- TIARRA_GROUP=${TIARRA_GROUP}
+USERS= ${TIARRA_USER}
+GROUPS= ${TIARRA_GROUP}
+
+SUB_FILES= pkg-message
PLIST_SUB= TIARRA_USER=${TIARRA_USER} \
TIARRA_GROUP=${TIARRA_GROUP}
@@ -32,7 +33,6 @@
TIARRA_GROUP= tiarra
do-install:
- @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
@${MKDIR} ${PREFIX}/tiarra
@${TAR} cfC - ${WRKSRC} . | ${TAR} xfC - ${PREFIX}/tiarra
@if [ ! -f ${PREFIX}/tiarra/tiarra.conf ]; then \
Index: files/pkg-deinstall.in
===================================================================
RCS file: files/pkg-deinstall.in
diff -N files/pkg-deinstall.in
--- files/pkg-deinstall.in 29 Jul 2006 07:17:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/japanese/tiarra/files/pkg-deinstall.in,v 1.1 2006/07/29 07:17:33 ume Exp $
-
-TIARRA_USER=${TIARRA_USER:=%%TIARRA_USER%%}
-TIARRA_GROUP=${TIARRA_GROUP:=%%TIARRA_GROUP%%}
-
-delete_user() {
- if pw usershow ${TIARRA_USER} 2>/dev/null 1>&2; then
- echo "To delete tiarra user permanently, use 'pw userdel ${TIARRA_USER}'"
- fi
- if pw groupshow ${TIARRA_GROUP} 2>/dev/null 1>&2; then
- echo "To delete tiarra group permanently, use 'pw groupdel ${TIARRA_GROUP}'"
- fi
-}
-
-case $2 in
-POST-DEINSTALL)
- delete_user
- ;;
-esac
Index: files/pkg-install.in
===================================================================
RCS file: files/pkg-install.in
diff -N files/pkg-install.in
--- files/pkg-install.in 29 Jul 2006 07:17:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,71 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/japanese/tiarra/files/pkg-install.in,v 1.1 2006/07/29 07:17:33 ume Exp $
-
-TIARRA_USER=${TIARRA_USER:=%%TIARRA_USER%%}
-TIARRA_GROUP=${TIARRA_GROUP:=%%TIARRA_GROUP%%}
-
-UID=398
-GID=398
-
-#
-# create 'tiarra' user and group before installing
-#
-
-create_user() {
- USER=${TIARRA_USER}
- GROUP=${TIARRA_GROUP}
- PW=/usr/sbin/pw
-
- if [ -x /usr/sbin/nologin ]; then
- shell=/usr/sbin/nologin
- elif [ -x /sbin/nologin ]; then
- shell=/sbin/nologin
- else
- shell=/nonexistent
- fi
- uhome="/nonexistent"
-
- if ! ${PW} show group ${GROUP} -q >/dev/null; then
- gid=${GID}
- while ${PW} show group -g ${gid} -q >/dev/null; do
- gid=`expr ${gid} + 1`
- done
- if ! ${PW} add group ${GROUP} -g ${gid}; then
- e=$?
- echo "*** Failed to add group \`${GROUP}'. Please add it manually."
- exit ${e}
- fi
- echo "*** Added group \`${GROUP}' (id ${gid})"
- else
- gid=`${PW} show group ${GROUP} 2>/dev/null | cut -d: -f3`
- fi
-
- if ! ${PW} show user ${USER} -q >/dev/null; then
- uid=${UID}
- while ${PW} show user -u ${uid} -q >/dev/null; do
- uid=`expr ${uid} + 1`
- done
- if ! ${PW} add user ${USER} -u ${uid} -g ${gid} -d "${uhome}" \
- -c "Tiarra IRC Proxy" -s "${shell}" -p "*" \
- ; then
- e=$?
- echo "*** Failed to add user \`${USER}'. Please add it manually."
- exit ${e}
- fi
- echo "*** Added user \`${USER}' (id ${uid})"
- else
- if ! ${PW} mod user ${USER} -g ${gid}; then
- e=$?
- echo "*** Failed to update user \`${USER}'."
- exit ${e}
- fi
- echo "*** Updated user \`${USER}'."
- fi
-}
-
-case $2 in
-PRE-INSTALL)
- create_user
- ;;
-esac
--- japanese-tiarra.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