From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Sep 23 12:20:01 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D78AAAF6 for ; Mon, 23 Sep 2013 12:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5E8827F6 for ; Mon, 23 Sep 2013 12:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NCK1e7090284 for ; Mon, 23 Sep 2013 12:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r8NCK1iJ090283; Mon, 23 Sep 2013 12:20:01 GMT (envelope-from gnats) Resent-Date: Mon, 23 Sep 2013 12:20:01 GMT Resent-Message-Id: <201309231220.r8NCK1iJ090283@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, Rodrigo (ros) OSORIO Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9FD3B917 for ; Mon, 23 Sep 2013 12:12:44 +0000 (UTC) (envelope-from rodrigo@bebik.net) Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [IPv6:2a01:e0c:1:1599::10]) by mx1.freebsd.org (Postfix) with ESMTP id 194EF27AD for ; Mon, 23 Sep 2013 12:12:42 +0000 (UTC) Received: from oldfaithful.bebik.local (unknown [82.227.164.69]) by smtp1-g21.free.fr (Postfix) with ESMTP id A4CC994001E for ; Mon, 23 Sep 2013 14:12:36 +0200 (CEST) Received: by oldfaithful.bebik.local (Postfix, from userid 1001) id A870A8056E3; Mon, 23 Sep 2013 14:02:34 +0200 (CEST) Message-Id: <20130923120234.A870A8056E3@oldfaithful.bebik.local> Date: Mon, 23 Sep 2013 14:02:34 +0200 (CEST) From: Rodrigo (ros) OSORIO To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/182318: new port: www/slowcgi X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "Rodrigo OSORIO \(ros\)" List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 12:20:01 -0000 >Number: 182318 >Category: ports >Synopsis: new port: www/slowcgi >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Sep 23 12:20:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Rodrigo (ros) OSORIO >Release: FreeBSD 9.0-RELEASE amd64 >Organization: >Environment: System: FreeBSD sisko 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Add new port www/slowcgi, a small and efficient fastcgi server imported from OpenBSD[1]. I did some changes regarding the user/group used by slowcgi, I add a slowcgi/slowcgi user (see GIDs and UIDs patch) with a home located in /var/slowcgi used to chroot lowcgi. This is a nologin account. The user www has been added to the slowcgi group in order to access the socket without changing the perms. Manpage was updated to reflect that changes. [1] http://www.openbsd.org/cgi-bin/man.cgi?query=slowcgi&manpath=OpenBSD%20Current&sektion=8&format=html >How-To-Repeat: >Fix: --- slowcgi.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # slowcgi # slowcgi/files # slowcgi/files/patch-slowcgi.c # slowcgi/files/patch-slowcgi.8 # slowcgi/files/slowcgi.in # slowcgi/pkg-descr # slowcgi/distinfo # slowcgi/Makefile # echo c - slowcgi mkdir -p slowcgi > /dev/null 2>&1 echo c - slowcgi/files mkdir -p slowcgi/files > /dev/null 2>&1 echo x - slowcgi/files/patch-slowcgi.c sed 's/^X//' >slowcgi/files/patch-slowcgi.c << '99bdc35e6fa14ae10614e7063cbf1d33' X--- slowcgi.c 2013-08-30 08:10:23.000000000 +0000 X+++ slowcgi.c 2013-09-19 11:48:54.000000000 +0000 X@@ -16,12 +16,14 @@ X * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. X */ X X+#include X #include X #include X #include X #include X #include X #include X+#include X #include X #include X #include X@@ -38,7 +40,7 @@ X #include X X #define TIMEOUT_DEFAULT 120 X-#define SLOWCGI_USER "www" X+#define SLOWCGI_USER "slowcgi" X #define FCGI_RECORD_SIZE 64*1024 X #define STDOUT_DONE 1 X #define STDERR_DONE 2 X@@ -145,7 +147,7 @@ X uint8_t protocol_status; X uint8_t reserved[3]; X }__packed; X-__dead void usage(void); X+__dead2 void usage(void); X void slowcgi_listen(char *, gid_t); X void slowcgi_paused(int, short, void*); X void slowcgi_accept(int, short, void*); X@@ -211,7 +213,7 @@ X #define linfo(_f...) logger->info(_f) X #define ldebug(_f...) logger->debug(_f) X X-__dead void X+__dead2 void X usage(void) X { X extern char *__progname; X@@ -223,7 +225,7 @@ X struct slowcgi_proc slowcgi_proc; X int debug = 0; X int on = 1; X-char *fcgi_socket = "/var/www/run/slowcgi.sock"; X+char *fcgi_socket = "/var/run/slowcgi.sock"; X X int X main(int argc, char *argv[]) 99bdc35e6fa14ae10614e7063cbf1d33 echo x - slowcgi/files/patch-slowcgi.8 sed 's/^X//' >slowcgi/files/patch-slowcgi.8 << '472a45e6a25623b4419752163bf09411' X--- slowcgi.8 2013-08-26 12:10:40.000000000 +0000 X+++ slowcgi.8 2013-09-19 12:01:49.000000000 +0000 X@@ -30,13 +30,13 @@ X .Pp X .Nm X opens a socket at X-.Pa /var/www/run/slowcgi.sock , X-owned by root:www, X+.Pa /var/run/slowcgi.sock , X+owned by slowcgi:slowcgi, X with permissions 0660. X It then X .Xr chroot 8 X to X-.Pa /var/www . X+.Pa /var/slowcgi . X .Pp X The options are as follows: X .Bl -tag -width Ds 472a45e6a25623b4419752163bf09411 echo x - slowcgi/files/slowcgi.in sed 's/^X//' >slowcgi/files/slowcgi.in << '1b787b76109d21f68500cb226c500374' X#!/bin/sh X X# $FreeBSD$ X# X# PROVIDE: slowcgi X# REQUIRE: LOGIN X# KEYWORD: shutdown X# X# Add the following lines to /etc/rc.conf.local or /etc/rc.conf X# to enable this service: X# X# slowcgi_enable (bool): Set to NO by default. X# Set it to YES to enable slowcgi. X# slowcgi_socket (path): Set to /var/run/slowcgi.sock X# by default. X X. /etc/rc.subr X Xname=slowcgi Xrcvar=slowcgi_enable X Xload_rc_config $name X: ${slowcgi_enable:="NO"} X: ${slowcgi_socket="/var/run/slowcgi.sock"} X Xcommand=%%PREFIX%%/bin/${name} X Xcommand_args="-s $slowcgi_socket" Xrun_rc_command "$1" 1b787b76109d21f68500cb226c500374 echo x - slowcgi/pkg-descr sed 's/^X//' >slowcgi/pkg-descr << 'd172c179eb686787b6a57ab1c1d67bd7' XSimple and lightweight server which implements Xthe FastCGI Protocol to execute CGI scripts X XWWW: http://ftp.fr.openbsd.org/pub/OpenBSD/src/usr.sbin/slowcgi/ d172c179eb686787b6a57ab1c1d67bd7 echo x - slowcgi/distinfo sed 's/^X//' >slowcgi/distinfo << 'e6a82b58f64e4b36e6cfc2cc242b2032' XSHA256 (slowcgi-1.4.tar.gz) = 6ebd08b3f7cfc20bb2de108c13125274875cc40ee07c81e0920834c41a46b0e8 XSIZE (slowcgi-1.4.tar.gz) = 7229 e6a82b58f64e4b36e6cfc2cc242b2032 echo x - slowcgi/Makefile sed 's/^X//' >slowcgi/Makefile << '32c35e81946d890ae8fe485a00aa65a0' X# Created by: Rodrigo OSORIO X# $FreeBSD$ X XPORTNAME= slowcgi XPORTVERSION= 1.4 XCATEGORIES= www XMASTER_SITES= http://rodrigo.osorio.free.fr/freebsd/distfiles/ X XMAINTAINER= rodrigo@bebik.net XCOMMENT= Simple fastcgi server to execute CGI scripts X XLICENSE= BSD X XLIB_DEPENDS= libevent.so:${PORTSDIR}/devel/libevent X XPLIST_FILES+= bin/slowcgi XUSE_RC_SUBR= slowcgi X XMANCOMPRESSED= yes X XUSERS= slowcgi XGROUPS= slowcgi X XMAN8= slowcgi.8 X XCFLAGS+= -I${LOCALBASE}/include/event/compat -I${LOCALBASE}/include XLDFLAGS+= -L${LOCALBASE}/lib X Xdo-install: X ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/${PORTNAME} X ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8.gz ${MAN1PREFIX}/man/man8 X X.include 32c35e81946d890ae8fe485a00aa65a0 exit --- slowcgi.shar ends here --- --- slowcgi_uidgid.diff begins here --- Index: /usr/ports/UIDs =================================================================== --- /usr/ports/UIDs (revision 327609) +++ /usr/ports/UIDs (working copy) @@ -269,4 +269,5 @@ plex:*:972:972::0:0:Plex Media Server:/nonexistent:/usr/sbin/nologin boinc:*:973:973::0:0:BOINC user:/var/db/boinc:/usr/sbin/nologin radicale:*:974:974::0:0:Radicale daemon:/nonexistent:/usr/sbin/nologin +slowcgi:*:975:975::0:0:slowcgi daemon:/var/slowcgi:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin Index: /usr/ports/GIDs =================================================================== --- /usr/ports/GIDs (revision 327609) +++ /usr/ports/GIDs (working copy) @@ -262,5 +262,6 @@ plex:*:972: boinc:*:973: radicale:*:974: +slowcgi:*:975:www nogroup:*:65533: nobody:*:65534: --- slowcgi_uidgid.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: