From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Oct 29 18:40:11 2010 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 4CE3710656C1 for ; Fri, 29 Oct 2010 18:40:11 +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 49E888FC16 for ; Fri, 29 Oct 2010 18:40:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9TIe8Or049839 for ; Fri, 29 Oct 2010 18:40:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9TIe8X9049838; Fri, 29 Oct 2010 18:40:08 GMT (envelope-from gnats) Resent-Date: Fri, 29 Oct 2010 18:40:08 GMT Resent-Message-Id: <201010291840.o9TIe8X9049838@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, Aragon Gouveia Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20BA6106566C for ; Fri, 29 Oct 2010 18:33:25 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 0E1A88FC1B for ; Fri, 29 Oct 2010 18:33:25 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o9TIXOmO049636 for ; Fri, 29 Oct 2010 18:33:24 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o9TIXOU3049635; Fri, 29 Oct 2010 18:33:24 GMT (envelope-from nobody) Message-Id: <201010291833.o9TIXOU3049635@www.freebsd.org> Date: Fri, 29 Oct 2010 18:33:24 GMT From: Aragon Gouveia To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/151819: [patch] net-p2p/uhub port improvements X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 18:40:11 -0000 >Number: 151819 >Category: ports >Synopsis: [patch] net-p2p/uhub port improvements >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: Fri Oct 29 18:40:07 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Aragon Gouveia >Release: 8.1-STABLE >Organization: >Environment: FreeBSD igor.geek.sh 8.1-STABLE FreeBSD 8.1-STABLE #0: Sat Jul 24 19:06:08 SAST 2010 toor@igor.geek.sh:/usr/obj/usr/src/sys/IGOR amd64 >Description: Attached patch makes some improvements to the net-p2p/uhub port: * Sets up a uhub UID and GID for the daemon to run as. * Modifies configuration file permissions to restrict them to root and the above GID. * Patches uhub source so that PREFIX/etc/uhub/uhub.conf is the compiled in default configuration file. * rc.d script changes - enable above uid/gid, enable syslog logging, simplify. I think these changes are an improvement. Please consider committing them. Thanks! >How-To-Repeat: >Fix: Patch attached with submission follows: --- net-p2p/uhub/Makefile.orig 2010-10-29 17:57:45.000000000 +0200 +++ net-p2p/uhub/Makefile 2010-10-29 20:24:54.000000000 +0200 @@ -7,7 +7,7 @@ PORTNAME= uhub PORTVERSION= 0.3.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net-p2p MASTER_SITES= http://www.extatic.org/downloads/uhub/ DISTNAME= ${PORTNAME}-${PORTVERSION}-src @@ -19,6 +19,10 @@ USE_GMAKE= yes USE_RC_SUBR= uhub.sh +USERS= uhub +GROUPS= uhub +SHAREGRP= uhub +SHAREMODE= 640 WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} MAKEFILE= ${WRKSRC}/GNUmakefile @@ -36,15 +40,18 @@ post-patch: @${REINPLACE_CMD} -e 's|/etc/uhub/|${PREFIX}&|' ${WRKSRC}/doc/uhub.conf + @${REINPLACE_CMD} -e 's|/etc/uhub/|${PREFIX}&|' ${WRKSRC}/src/uhub.h -post-install: +do-install: + @${INSTALL_PROGRAM} ${WRKSRC}/uhub ${PREFIX}/bin/uhub + @${MKDIR} ${PREFIX}/etc/uhub @${INSTALL_DATA} ${WRKSRC}/doc/uhub.conf ${PREFIX}/etc/uhub/uhub.conf.sample @${INSTALL_DATA} ${WRKSRC}/doc/users.conf ${PREFIX}/etc/uhub/users.conf.sample - @if [ -f ${PREFIX}/etc/uhub/motd.txt ]; then \ - ${TOUCH} ${PREFIX}/etc/uhub/motd.txt.sample ; \ - fi - @if [ -f ${PREFIX}/etc/uhub/rules.txt ]; then \ - ${TOUCH} ${PREFIX}/etc/uhub/rules.txt.sample ; \ - fi + @${INSTALL_DATA} /dev/null ${PREFIX}/etc/uhub/motd.txt.sample + @${INSTALL_DATA} /dev/null ${PREFIX}/etc/uhub/rules.txt.sample +.for i in uhub.conf users.conf motd.txt rules.txt + @[ ! -f ${PREFIX}/etc/uhub/${i} ] \ + && cp -p ${PREFIX}/etc/uhub/${i}.sample ${PREFIX}/etc/uhub/${i} +.endfor .include --- net-p2p/uhub/files/uhub.sh.in.orig 2010-10-29 18:25:29.000000000 +0200 +++ net-p2p/uhub/files/uhub.sh.in 2010-10-29 20:18:27.000000000 +0200 @@ -11,8 +11,6 @@ # # uhub_enable (bool): Set it to "YES" to enable uhub # Default is "NO". -# uhub_conf (path): Set full path to config file. -# Default is "%%PREFIX%%/etc/uhub/uhub.conf". # uhub_pidfile (path): Set full path to pid file. # Default is "/var/run/uhub.pid". # @@ -24,12 +22,12 @@ load_rc_config $name -: ${uhub_enable="NO"} -: ${uhub_conf="%%PREFIX%%/etc/uhub/uhub.conf"} -: ${uhub_pidfile="/var/run/${name}.pid"} +: ${uhub_enable:="NO"} +: ${uhub_flags:="-L -u uhub -g uhub"} +: ${uhub_pidfile:="/var/run/${name}.pid"} command=%%PREFIX%%/bin/uhub -command_args="-fq -c ${uhub_conf} -p ${uhub_pidfile}" +command_args="-f -p ${uhub_pidfile}" pidfile=${uhub_pidfile} required_files=${uhub_conf} stop_postcmd=stop_postcmd --- UIDs.orig 2010-10-29 18:54:35.000000000 +0200 +++ UIDs 2010-10-29 18:55:29.000000000 +0200 @@ -128,6 +128,7 @@ httptunnel:*:361:361::0:0:httptunnel Daemon:/nonexistent:/usr/sbin/nologin ldap:*:389:389::0:0:OpenLDAP Server:/nonexistent:/usr/sbin/nologin tiarra:*:398:398::0:0:Tiarra IRC Proxy:/nonexistent:/usr/sbin/nologin +uhub:*:411:411::0:0:uHub ADC Daemon:/nonexistent:/usr/sbin/nologin drweb:*:426:426::0:0:Dr.Web Mail Scanner:/nonexistent:/usr/sbin/nologin callweaver:*:444:444::0:0:Callweaver account:/var/lib/callweaver:/usr/sbin/nologin courier:*:465:465::0:0:Courier Mail Server:/nonexistent:/usr/sbin/nologin --- GIDs.orig 2010-10-29 18:54:39.000000000 +0200 +++ GIDs 2010-10-29 18:55:48.000000000 +0200 @@ -118,6 +118,7 @@ httptunnel:*:361: ldap:*:389: tiarra:*:398: +uhub:*:411: drweb:*:426: callweaver:*:444: courier:*:465: >Release-Note: >Audit-Trail: >Unformatted: