From owner-svn-ports-head@FreeBSD.ORG Sun Jan 18 13:37:38 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B49D30A; Sun, 18 Jan 2015 13:37:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BB0EE7E; Sun, 18 Jan 2015 13:37:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0IDbcHc037354; Sun, 18 Jan 2015 13:37:38 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0IDbZt1037338; Sun, 18 Jan 2015 13:37:35 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201501181337.t0IDbZt1037338@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Sun, 18 Jan 2015 13:37:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r377327 - in head/www/thttpd: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2015 13:37:38 -0000 Author: danfe Date: Sun Jan 18 13:37:34 2015 New Revision: 377327 URL: https://svnweb.freebsd.org/changeset/ports/377327 QAT: https://qat.redports.org/buildarchive/r377327/ Log: - Update to version 2.26 and cleanup MASTER_SITES; define LICENSE - Change default WWW root from ${PREFIX}/www/data to more expected (and standard) ${WWWDIR} (${PREFIX}/www/thttpd) and default CGI pattern to "/cgi-bin/*" since this goes better in line with default installation - Enable IPREAL option by default (do not convert it to unconditional patch as it could lead to privacy violation, which might be unwanted) - Change served data default MIME type to "application/octet-stream" - Rename thttpdpasswd(1) and its manpage to thtpasswd(1); this not just makes it shorter, but is more consistent with what popular GNU/Linux distributions do - Stop generating index pages for directories by default for security reasons, provide an option for that - Properly stagify port by patching upstream makefiles instead of doing entire installation by hand (and thus retire `do-install' target) - Adjust and sort pkg-plist in accordance with the the above changes Modified: head/www/thttpd/Makefile head/www/thttpd/distinfo head/www/thttpd/files/patch-Makefile.in head/www/thttpd/files/patch-cgi-src_Makefile.in head/www/thttpd/files/patch-extras_Makefile.in head/www/thttpd/files/patch-extras_htpasswd.c head/www/thttpd/files/patch-libhttpd.c head/www/thttpd/files/patch-thttpd.c head/www/thttpd/files/pkg-message.in head/www/thttpd/files/thttpd.conf.sample.in head/www/thttpd/pkg-plist Modified: head/www/thttpd/Makefile ============================================================================== --- head/www/thttpd/Makefile Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/Makefile Sun Jan 18 13:37:34 2015 (r377327) @@ -2,54 +2,47 @@ # $FreeBSD$ PORTNAME= thttpd -PORTVERSION= 2.25b -PORTREVISION= 6 +PORTVERSION= 2.26 CATEGORIES= www ipv6 -MASTER_SITES= http://www.acme.com/software/thttpd/ \ - http://atreides.freenix.no/~anders/ +MASTER_SITES= http://www.acme.com/software/thttpd/ MAINTAINER= danfe@FreeBSD.org COMMENT= Tiny/turbo/throttling HTTP server with CGI support +LICENSE= BSD2CLAUSE + USES= gmake # parallel builds (-jX) are broken with BSD make(1) GNU_CONFIGURE= yes +MAKE_ARGS= WEBDIR=${WWWDIR} USE_RC_SUBR= ${PORTNAME} SUB_FILES= pkg-message thttpd.conf.sample SUB_LIST= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} -OPTIONS_DEFINE= SENDFILE IPREAL -OPTIONS_DEFAULT= SENDFILE +OPTIONS_DEFINE= SENDFILE IPREAL INDEXES +OPTIONS_DEFAULT= SENDFILE IPREAL + SENDFILE_DESC= Use sendfile(2) to serve files IPREAL_DESC= Respect (pass on) "X-Forwarded-For" header +INDEXES_DESC= Generate index pages for directories SENDFILE_EXTRA_PATCHES= ${FILESDIR}/extra-patch-config.h IPREAL_EXTRA_PATCHES= ${FILESDIR}/extra-patch-ip_real +.include + post-patch: -.for f in extras/htpasswd.1 extras/htpasswd.c thttpd.8 extras/Makefile.in - @${REINPLACE_CMD} -e '/\.htpasswd/!s|htpasswd|thttpdpasswd|g' \ - ${WRKSRC}/${f} +# To avoid conflict with other ports that also install htpasswd(1) +.for f in extras/htpasswd.1 extras/htpasswd.c thttpd.8 + @${REINPLACE_CMD} -e '/\.htpasswd/!s|htpasswd|t&|g' ${WRKSRC}/${f} .endfor @${REINPLACE_CMD} -e 's|/var/www|${WWWDIR}|' \ ${WRKSRC}/extras/makeweb.1 - @${MV} ${WRKSRC}/extras/htpasswd.1 ${WRKSRC}/extras/thttpdpasswd.1 - @${MV} ${WRKSRC}/extras/htpasswd.c ${WRKSRC}/extras/thttpdpasswd.c +.if ! ${PORT_OPTIONS:MINDEXES} + @${REINPLACE_CMD} -e '/GENERATE_INDEXES/s|.*|/* & */|' \ + ${WRKSRC}/config.h +.endif -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/thttpd ${STAGEDIR}${PREFIX}/sbin - ${INSTALL_PROGRAM} ${WRKSRC}/extras/makeweb \ - ${WRKSRC}/extras/thttpdpasswd ${STAGEDIR}${PREFIX}/bin - ${INSTALL_SCRIPT} ${WRKSRC}/extras/syslogtocern \ - ${STAGEDIR}${PREFIX}/bin - @${MKDIR} ${STAGEDIR}${PREFIX}/www/data \ - ${STAGEDIR}${PREFIX}/www/cgi-bin - ${INSTALL_PROGRAM} ${WRKSRC}/cgi-src/redirect ${WRKSRC}/cgi-src/ssi \ - ${WRKSRC}/cgi-src/phf ${STAGEDIR}${PREFIX}/www/cgi-bin - ${INSTALL_MAN} ${WRKSRC}/extras/makeweb.1 \ - ${WRKSRC}/extras/thttpdpasswd.1 ${STAGEDIR}${PREFIX}/man/man1 - ${INSTALL_MAN} ${WRKSRC}/thttpd.8 ${WRKSRC}/cgi-src/redirect.8 \ - ${WRKSRC}/cgi-src/ssi.8 ${WRKSRC}/extras/syslogtocern.8 \ - ${STAGEDIR}${PREFIX}/man/man8 +post-install: ${INSTALL_DATA} ${WRKDIR}/thttpd.conf.sample ${STAGEDIR}${PREFIX}/etc .include Modified: head/www/thttpd/distinfo ============================================================================== --- head/www/thttpd/distinfo Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/distinfo Sun Jan 18 13:37:34 2015 (r377327) @@ -1,2 +1,2 @@ -SHA256 (thttpd-2.25b.tar.gz) = 07719b08b1cff6a21c08697a7bcb4395425b07ee753106262fb62a03a7d32360 -SIZE (thttpd-2.25b.tar.gz) = 132275 +SHA256 (thttpd-2.26.tar.gz) = 15b3f6c60f854061e333227e9ea9ff789d34a092c9365690a8c0d3ecfc85cbb7 +SIZE (thttpd-2.26.tar.gz) = 132950 Modified: head/www/thttpd/files/patch-Makefile.in ============================================================================== --- head/www/thttpd/files/patch-Makefile.in Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/files/patch-Makefile.in Sun Jan 18 13:37:34 2015 (r377327) @@ -20,7 +20,17 @@ WEBDIR=$(WEBDIR) \ CGIBINDIR=$(CGIBINDIR) \ MANDIR=$(MANDIR) \ -@@ -118,9 +116,7 @@ install-man: +@@ -110,17 +108,15 @@ install: installthis install-man install + + installthis: + -mkdir -p $(DESTDIR)$(BINDIR) +- $(INSTALL) -m 555 -o bin -g bin thttpd $(DESTDIR)$(BINDIR) ++ $(INSTALL) -m 555 thttpd $(DESTDIR)$(BINDIR) + + install-man: + -mkdir -p $(DESTDIR)$(MANDIR)/man8 +- $(INSTALL) -m 444 -o bin -g bin thttpd.8 $(DESTDIR)$(MANDIR)/man8 ++ $(INSTALL) -m 444 thttpd.8 $(DESTDIR)$(MANDIR)/man8 installsubdirs: for i in $(SUBDIRS) ; do ( \ Modified: head/www/thttpd/files/patch-cgi-src_Makefile.in ============================================================================== --- head/www/thttpd/files/patch-cgi-src_Makefile.in Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/files/patch-cgi-src_Makefile.in Sun Jan 18 13:37:34 2015 (r377327) @@ -9,3 +9,32 @@ DEFS = @DEFS@ INCLS = -I.. CFLAGS = $(CCOPT) $(DEFS) $(INCLS) +@@ -67,17 +67,17 @@ + cd .. ; $(MAKE) $(MFLAGS) strerror.o + + install: all +- -mkdir -p $(CGIBINDIR) +- rm -f $(CGIBINDIR)/redirect +- cp redirect $(CGIBINDIR)/redirect +- rm -f $(MANDIR)/man8/redirect.8 +- cp redirect.8 $(MANDIR)/man8/redirect.8 +- rm -f $(CGIBINDIR)/ssi +- cp ssi $(CGIBINDIR)/ssi +- rm -f $(MANDIR)/man8/ssi.8 +- cp ssi.8 $(MANDIR)/man8/ssi.8 +- rm -f $(CGIBINDIR)/phf +- cp phf $(CGIBINDIR)/phf ++ -mkdir -p $(DESTDIR)$(CGIBINDIR) ++ rm -f $(DESTDIR)$(CGIBINDIR)/redirect ++ cp redirect $(DESTDIR)$(CGIBINDIR)/redirect ++ rm -f $(DESTDIR)$(MANDIR)/man8/redirect.8 ++ cp redirect.8 $(DESTDIR)$(MANDIR)/man8/redirect.8 ++ rm -f $(DESTDIR)$(CGIBINDIR)/ssi ++ cp ssi $(DESTDIR)$(CGIBINDIR)/ssi ++ rm -f $(DESTDIR)$(MANDIR)/man8/ssi.8 ++ cp ssi.8 $(DESTDIR)$(MANDIR)/man8/ssi.8 ++ rm -f $(DESTDIR)$(CGIBINDIR)/phf ++ cp phf $(DESTDIR)$(CGIBINDIR)/phf + + clean: + rm -f $(CLEANFILES) Modified: head/www/thttpd/files/patch-extras_Makefile.in ============================================================================== --- head/www/thttpd/files/patch-extras_Makefile.in Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/files/patch-extras_Makefile.in Sun Jan 18 13:37:34 2015 (r377327) @@ -9,3 +9,32 @@ DEFS = @DEFS@ INCLS = -I.. CFLAGS = $(CCOPT) $(DEFS) $(INCLS) +@@ -66,18 +66,16 @@ + + + install: all +- rm -f $(BINDIR)/makeweb $(BINDIR)/htpasswd $(BINDIR)/syslogtocern +- cp makeweb $(BINDIR)/makeweb +- chgrp $(WEBGROUP) $(BINDIR)/makeweb +- chmod 2755 $(BINDIR)/makeweb +- cp htpasswd $(BINDIR)/htpasswd +- cp syslogtocern $(BINDIR)/syslogtocern +- rm -f $(MANDIR)/man1/makeweb.1 +- cp makeweb.1 $(MANDIR)/man1/makeweb.1 +- rm -f $(MANDIR)/man1/htpasswd.1 +- cp htpasswd.1 $(MANDIR)/man1/htpasswd.1 +- rm -f $(MANDIR)/man8/syslogtocern.8 +- cp syslogtocern.8 $(MANDIR)/man8/syslogtocern.8 ++ rm -f $(DESTDIR)$(BINDIR)/makeweb $(DESTDIR)$(BINDIR)/thtpasswd $(DESTDIR)$(BINDIR)/syslogtocern ++ cp makeweb $(DESTDIR)$(BINDIR)/makeweb ++ cp htpasswd $(DESTDIR)$(BINDIR)/thtpasswd ++ cp syslogtocern $(DESTDIR)$(BINDIR)/syslogtocern ++ rm -f $(DESTDIR)$(MANDIR)/man1/makeweb.1 ++ cp makeweb.1 $(DESTDIR)$(MANDIR)/man1/makeweb.1 ++ rm -f $(DESTDIR)$(MANDIR)/man1/thtpasswd.1 ++ cp htpasswd.1 $(DESTDIR)$(MANDIR)/man1/thtpasswd.1 ++ rm -f $(DESTDIR)$(MANDIR)/man8/syslogtocern.8 ++ cp syslogtocern.8 $(DESTDIR)$(MANDIR)/man8/syslogtocern.8 + + clean: + rm -f $(CLEANFILES) Modified: head/www/thttpd/files/patch-extras_htpasswd.c ============================================================================== --- head/www/thttpd/files/patch-extras_htpasswd.c Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/files/patch-extras_htpasswd.c Sun Jan 18 13:37:34 2015 (r377327) @@ -143,9 +143,9 @@ strcpy(user,argv[2]); found = 0; -- while(!(getline(line,MAX_STRING_LEN,f))) { +- while(!(my_getline(line,MAX_STRING_LEN,f))) { + /* line we get is username:pwd, or possibly any other cruft */ -+ while(!(getline(line,MAX_LINE_LEN,f))) { ++ while(!(my_getline(line,MAX_LINE_LEN,f))) { + char *i; + if(found || (line[0] == '#') || (!line[0])) { Modified: head/www/thttpd/files/patch-libhttpd.c ============================================================================== --- head/www/thttpd/files/patch-libhttpd.c Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/files/patch-libhttpd.c Sun Jan 18 13:37:34 2015 (r377327) @@ -18,7 +18,39 @@ rest[--restlen] = '\0'; /* trim trailing slash */ if ( ! tildemapped ) /* Remove any leading slashes. */ -@@ -3889,6 +3889,9 @@ +@@ -2348,8 +2348,11 @@ + { + int i; + i = strlen( hc->origfilename ) - strlen( hc->pathinfo ); +- if ( i > 0 && strcmp( &hc->origfilename[i], hc->pathinfo ) == 0 ) +- hc->origfilename[i - 1] = '\0'; ++ if ( strcmp( &hc->origfilename[i], hc->pathinfo ) == 0 ) ++ { ++ if ( i == 0 ) hc->origfilename[0] = '\0'; ++ else hc->origfilename[i - 1] = '\0'; ++ } + } + + /* If the expanded filename is an absolute path, check that it's still +@@ -2571,7 +2574,7 @@ + size_t ext_len, encodings_len; + int i, top, bot, mid; + int r; +- char* default_type = "text/plain; charset=%s"; ++ char* default_type = "application/octet-stream"; + + /* Peel off encoding extensions until there aren't any more. */ + n_me_indexes = 0; +@@ -3312,7 +3315,7 @@ + cp += strcspn( cp, " \t" ); + status = atoi( cp ); + } +- if ( ( cp = strstr( headers, "Location:" ) ) != (char*) 0 && ++ else if ( ( cp = strstr( headers, "Location:" ) ) != (char*) 0 && + cp < br && + ( cp == headers || *(cp-1) == '\012' ) ) + status = 302; +@@ -3889,6 +3892,9 @@ httpd_send_err( hc, 500, err500title, "", err500form, hc->encodedurl ); return -1; } Modified: head/www/thttpd/files/patch-thttpd.c ============================================================================== --- head/www/thttpd/files/patch-thttpd.c Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/files/patch-thttpd.c Sun Jan 18 13:37:34 2015 (r377327) @@ -13,7 +13,7 @@ syslog( LOG_NOTICE, "re-opening logfile" ); logfp = fopen( logfile, "a" ); - if ( logfp == (FILE*) 0 ) -+ retchmod = chmod( logfile, S_IRUSR|S_IWUSR ); ++ retchmod = chmod( logfile, S_IRUSR|S_IWUSR|S_IRGRP ); + if ( logfp == (FILE*) 0 || retchmod != 0 ) { syslog( LOG_CRIT, "re-opening %.80s - %m", logfile ); Modified: head/www/thttpd/files/pkg-message.in ============================================================================== --- head/www/thttpd/files/pkg-message.in Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/files/pkg-message.in Sun Jan 18 13:37:34 2015 (r377327) @@ -3,7 +3,7 @@ If you want users to be able to create t subdirectories off of the main web directory, you need to: 1. Add a group for www admins (e.g., "%%WWWGRP%%") - 2. chgrp thatgroup %%PREFIX%%/bin/makeweb %%PREFIX%%/www + 2. chgrp thatgroup %%PREFIX%%/bin/makeweb %%WWWDIR%% 3. chmod 2755 %%PREFIX%%/bin/makeweb 4. Tell users about makeweb(1) Modified: head/www/thttpd/files/thttpd.conf.sample.in ============================================================================== --- head/www/thttpd/files/thttpd.conf.sample.in Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/files/thttpd.conf.sample.in Sun Jan 18 13:37:34 2015 (r377327) @@ -1,6 +1,6 @@ user=%%WWWOWN%% -dir=%%PREFIX%%/www/data +dir=%%WWWDIR%% chroot -cgipat=*.cgi +cgipat=/cgi-bin/* logfile=/var/log/thttpd.log pidfile=/var/run/thttpd.pid Modified: head/www/thttpd/pkg-plist ============================================================================== --- head/www/thttpd/pkg-plist Sun Jan 18 12:32:54 2015 (r377326) +++ head/www/thttpd/pkg-plist Sun Jan 18 13:37:34 2015 (r377327) @@ -1,16 +1,14 @@ -bin/thttpdpasswd -bin/makeweb -bin/syslogtocern @sample etc/thttpd.conf.sample man/man1/makeweb.1.gz -man/man1/thttpdpasswd.1.gz +man/man1/thtpasswd.1.gz man/man8/redirect.8.gz man/man8/ssi.8.gz man/man8/syslogtocern.8.gz man/man8/thttpd.8.gz +sbin/makeweb +sbin/syslogtocern sbin/thttpd -www/cgi-bin/phf -www/cgi-bin/redirect -www/cgi-bin/ssi -@dirrmtry www/cgi-bin -@dirrmtry www/data +sbin/thtpasswd +%%WWWDIR%%/cgi-bin/phf +%%WWWDIR%%/cgi-bin/redirect +%%WWWDIR%%/cgi-bin/ssi