Bug 157581 - Fix port: irc/ircd-ru should use USERS
Summary: Fix port: irc/ircd-ru should use USERS
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Chris Rees
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-04 10:10 UTC by Chris Rees
Modified: 2011-06-30 09:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rees 2011-06-04 10:10:09 UTC
	

	This port uses pkg-install to create new users instead of using USERS= and GROUPS=

It also tries to delete users on deinstall without prompting -- this is a problem if another installed port uses that username.

Fix: - Use USERS and GROUPS

	Submitted by: Chris Rees (utisoft@gmail.com)

	Please bear in mind that pkg-install has been removed.




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.--E7hbNv7THqYLAnOb5nvapQEFY0hs5cOyOBi9PyuTc6jXHJkR
Content-Type: text/plain; name="irc-ircd-ru.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="irc-ircd-ru.patch"

Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/irc/ircd-ru/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile	19 Apr 2010 10:43:24 -0000	1.17
+++ Makefile	2 Jun 2011 19:22:51 -0000
@@ -21,6 +21,9 @@
 USE_RC_SUBR=	ircd
 WRKSRC=		${WRKDIR}/ircd-RU-${PORTVERSION}-03-rc
 
+USERS=		ircd
+GROUPS=		${USERS}
+
 VARDIR=		/var
 PLIST_SUB=	VARDIR=${VARDIR}
 
@@ -87,9 +90,6 @@
 	@${ECHO_MSG} " Edit ${WRKSRC}/include/config.h for specific settings "
 	@${ECHO_MSG} ""
 
-pre-install:
-	@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
 post-install:
 	@${CHOWN} -R ircd:ircd ${VARDIR}/log/ircd-ru
 	@${CAT} ${PKGMESSAGE}
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install	7 Aug 2003 13:14:37 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-# This script is a modified copy of the pkg-install script 
-# from the original ircd-hybrid port.
-
-if [ "x$2" != "xPRE-INSTALL" ]; then
-	exit 0;
-fi
-
-
-if ! which -s pw ; then
-	cat <<EOF
-Your system does not include the "pw" utility.  You should upgrade
-to a newer version of FreeBSD.  Without "pw" this script will not
-run.
-EOF
-	exit 1
-fi
-
-uid=72
-user=ircd
-gid=$uid
-group=$user
-gecos="Russian IRC daemon" 
-shell="/bin/sh"
-home="/nonexistent"
-
-echo ""
-if pw groupshow $group 2> /dev/null ; then
-	echo "You already have a group \"$group\", so I will use it."
-else
-	if pw groupshow $gid 2> /dev/null ; then
-		echo "You already have a gid \"$gid\".  Please create a user \"$group\""
-		echo "with a default group of \"$group\"."
-		exit 1
-	fi
-	echo "You need a group \"$group\"."
-	if which -s pw ; then
-		pw groupadd $group -g $gid || exit
-		echo "Done."
-	else
-		echo "Please create it, and try again."
-		if ! pw usershow $user 2> /dev/null ; then
-			echo "While you're at it, please create a user \"$user\""
-			echo 'too, with a default group of "$group".'
-		fi
-		exit 1
-	fi
-fi
-
-if pw usershow $user 2> /dev/null ; then
-	echo "You already have a user \"$user\", so I will use it."
-else
-        if pw usershow $uid 2> /dev/null ; then
-                echo "You already have a uid \"$uid\".  Please create a user \"ircd\""
-                echo "with a default group of \"$group\"."
-                exit 1
-        fi
-	echo "You need a user \"$user\"."
-	if which -s pw; then
-		pw useradd $user -g $group -u $uid -h - -d $home \
-			-s "$shell" -c "$gecos" || exit
-		echo "Done."
-	else
-		echo "Please create it, and try again."
-		exit 1
-	fi
-fi
Index: pkg-plist
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/irc/ircd-ru/pkg-plist,v
retrieving revision 1.7
diff -u -r1.7 pkg-plist
--- pkg-plist	30 Dec 2006 19:49:40 -0000	1.7
+++ pkg-plist	2 Jun 2011 19:24:40 -0000
@@ -28,4 +28,4 @@
 @exec chown ircd:ircd %%VARDIR%%/log/ircd-ru
 @unexec rmdir %%VARDIR%%/log/ircd-ru
 @unexec rmdir %%VARDIR%%/run/ircd-ru
-@unexec (rmdir %D/etc/ircd-ru && pw user del ircd) || echo 'To completely remove this port delete user ircd, group ircd and remove etc/ircd-ru'
+@unexec rmdir %D/etc/ircd-ru || echo 'To completely remove this port remove etc/ircd-ru'
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-04 10:10:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

pgollucci@ wants his PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-04 10:10:28 UTC
Maintainer of irc/ircd-ru,

Please note that PR ports/157581 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157581

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-04 10:10:30 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Andrey V. Elsukov 2011-06-04 10:21:00 UTC
On 04.06.2011 13:10, Edwin Groothuis wrote:
> Maintainer of irc/ircd-ru,
> 
> Please note that PR ports/157581 has just been submitted.
> 
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
> 
> The full text of the PR can be found at:
>     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157581


I am not against it. Thanks.

-- 
WBR, Andrey V. Elsukov
Comment 5 Chris Rees freebsd_committer freebsd_triage 2011-06-22 17:52:30 UTC
Responsible Changed
From-To: pgollucci->crees

Invalid autoassignment
Comment 6 Chris Rees freebsd_committer freebsd_triage 2011-06-26 17:25:40 UTC
State Changed
From-To: feedback->open

Maintainer has approved.
Comment 7 Chris Rees freebsd_committer freebsd_triage 2011-06-27 21:30:33 UTC
Hi Andrey,

Sorry to mess you about -- I've just noticed that the port uses

@unexec rmdir %D/ ||

which has now been replaced with @dirrmtry, as well as using ETCDIR in 
pkg-plist.

It also clobbers kline.conf on upgrade -- not a good idea if you want to 
keep your server safe!

Patch at [1] should suffice. Is it OK with you?

Chris

[1] http://people.freebsd.org/~crees/patches/ircd-ru-clobber-kline-conf.diff

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Comment 8 Andrey V. Elsukov freebsd_committer freebsd_triage 2011-06-28 05:05:09 UTC
On 28.06.2011 0:30, Chris Rees wrote:
> Hi Andrey,
> 
> Sorry to mess you about -- I've just noticed that the port uses
> 
> @unexec rmdir %D/ ||
> 
> which has now been replaced with @dirrmtry, as well as using ETCDIR in pkg-plist.
> 
> It also clobbers kline.conf on upgrade -- not a good idea if you want to keep your server safe!
> 
> Patch at [1] should suffice. Is it OK with you?
> 
> [1] http://people.freebsd.org/~crees/patches/ircd-ru-clobber-kline-conf.diff

Hi, it's ok. Thanks.

-- 
WBR, Andrey V. Elsukov
Comment 9 dfilter service freebsd_committer freebsd_triage 2011-06-28 19:44:13 UTC
crees       2011-06-28 18:44:05 UTC

  FreeBSD ports repository

  Modified files:
    irc/ircd-ru          Makefile pkg-plist 
  Removed files:
    irc/ircd-ru          pkg-install 
  Log:
  - Use USERS and GROUPS
  - Stop clobbering kline.conf on deinstall
  - Use %%ETCDIR%%
  - Use @dirrmtry
  
  PR:             ports/157581
  Submitted by:   Chris Rees <utisoft@gmail.com> (me)
  Approved by:    rene (mentor), maintainer
  
  Revision  Changes    Path
  1.18      +3 -3      ports/irc/ircd-ru/Makefile
  1.2       +0 -68     ports/irc/ircd-ru/pkg-install (dead)
  1.8       +11 -10    ports/irc/ircd-ru/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 10 Chris Rees freebsd_committer freebsd_triage 2011-06-30 09:20:47 UTC
State Changed
From-To: open->closed

Committed. Thanks!