Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2013 14:02:34 +0200 (CEST)
From:      Rodrigo (ros) OSORIO <rodrigo@bebik.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/182318: new port: www/slowcgi
Message-ID:  <20130923120234.A870A8056E3@oldfaithful.bebik.local>
Resent-Message-ID: <201309231220.r8NCK1iJ090283@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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 <netinet/in.h>
X #include <sys/types.h>
X #include <sys/ioctl.h>
X #include <sys/queue.h>
X #include <sys/socket.h>
X #include <sys/socketvar.h>
X #include <sys/stat.h>
X+#include <sys/param.h>
X #include <sys/un.h>
X #include <sys/wait.h>
X #include <err.h>
X@@ -38,7 +40,7 @@
X #include <unistd.h>
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 <rodrigo@bebik.net>
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 <bsd.port.mk>
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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130923120234.A870A8056E3>