From jarrod@burbank.downtools.com.au  Sat May  5 03:27:54 2012
Return-Path: <jarrod@burbank.downtools.com.au>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3E5DF1065672
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 May 2012 03:27:54 +0000 (UTC)
	(envelope-from jarrod@burbank.downtools.com.au)
Received: from mail.downtools.com.au (mail.downtools.com.au [123.136.33.243])
	by mx1.freebsd.org (Postfix) with ESMTP id A5E9A8FC0A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 May 2012 03:27:53 +0000 (UTC)
Received: from burbank.downtools.com.au (burbank.downtools.com.au [123.136.33.245])
	by mail.downtools.com.au (8.14.4/8.14.4) with ESMTP id q452w7Jd057203
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 5 May 2012 12:28:08 +0930 (CST)
	(envelope-from jarrod@burbank.downtools.com.au)
Received: from burbank.downtools.com.au (localhost [127.0.0.1])
	by burbank.downtools.com.au (8.14.5/8.14.5) with ESMTP id q452w7Xn057196;
	Sat, 5 May 2012 12:28:07 +0930 (CST)
	(envelope-from jarrod@burbank.downtools.com.au)
Received: (from jarrod@localhost)
	by burbank.downtools.com.au (8.14.5/8.14.5/Submit) id q452w7vo057195;
	Sat, 5 May 2012 12:28:07 +0930 (CST)
	(envelope-from jarrod)
Message-Id: <201205050258.q452w7vo057195@burbank.downtools.com.au>
Date: Sat, 5 May 2012 12:28:07 +0930 (CST)
From: Jarrod Sayers <jarrod@downtools.com.au>
Reply-To: Jarrod Sayers <jarrod@downtools.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] ports-mgmt/tinderbox: Allow masking of PHP use and display_markup_log action
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         167601
>Category:       ports
>Synopsis:       [patch] ports-mgmt/tinderbox: Allow masking of PHP use and display_markup_log action
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    crees
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 05 03:30:08 UTC 2012
>Closed-Date:    Tue Mar 25 20:49:48 UTC 2014
>Last-Modified:  Mon Apr  7 18:10:00 UTC 2014
>Originator:     Jarrod Sayers
>Release:        
>Organization:
>Environment:
>Description:
Tinderbox uses a hardcoded filename of index.php to refer to itself in
hyperlinks within the application.  When used with Apache (and likely other
web servers) a correctly defined DirectoryIndex can remove the requirement
to include the filename in these links.  This (the HIDE_PHP knob) then
assists in not easily disclosing the use of PHP when used in a public space.

In addition to this, disclosure of log files may not be desired and while
the "log" links can be controlled using "Allow from" controls, the
display_markup_log action does not support any equivalent.  A second option
(the HIDE_MARKUP knob) removes the links from uses of "markup" and disables
the use of the action by forcing a build and port identifier of -1 which
does not exist.

Both are off by default.
>How-To-Repeat:
>Fix:
Attached diff can be downloaded from:
http://www.downtools.com.au/~jarrod/FreeBSD/ports-mgmt-tinderbox-WITH_HIDE_PHP.diff
 
 
--- ports-mgmt-tinderbox-WITH_HIDE_PHP.diff begins here ---
diff -ruN ports/ports-mgmt/tinderbox.orig/Makefile ports/ports-mgmt/tinderbox/Makefile
--- ports/ports-mgmt/tinderbox.orig/Makefile	2012-01-15 02:46:08.000000000 +1030
+++ ports/ports-mgmt/tinderbox/Makefile	2012-05-05 12:07:15.000000000 +0930
@@ -25,6 +25,8 @@
 		HIAWATHA "Use Hiawatha for web interface" Off \
 		LIGHTTPD "Use LightHTTPD for web interface" Off \
 		CHECK_FOR_ROOT "Check if ./tc is run by uid 0" On \
+		HIDE_PHP "Hide index.php in webui templates" off \
+		HIDE_MARKUP "Hide display_markup_log action" off \
 		LSOF "For killMountProcesses() when using nullfs" On
 
 NO_BUILD=	yes
@@ -102,6 +104,15 @@
 .endif
 	${REINPLACE_CMD} -e 's/.set_rcvar./tinderd_enable/' \
 		${WRKSRC}/etc/rc.d/tinderd
+.if defined(WITH_WEBUI)
+.if defined(WITH_HIDE_PHP)
+	@${REINPLACE_CMD} -e 's#index.php\?#\?#g' -e 's#index.php#\?#g' ${WRKSRC}/webui/templates/*/*.tpl
+.endif
+.if defined(WITH_HIDE_MARKUP)
+	@${REINPLACE_CMD} -e 's#<a href="[^"]*">markup</a>#markup#g' -e 's#>markup_log.*;#>markup_log(-1,-1)#g' \
+		${WRKSRC}/webui/templates/*/*.tpl ${WRKSRC}/webui/index.php
+.endif
+.endif
 	@cd ${WRKSRC} && ${FIND} -E . -regex '.*(orig|bak)' -exec ${RM} {} \;
 
 do-install:
--- ports-mgmt-tinderbox-WITH_HIDE_PHP.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->itetcu 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat May 5 03:30:20 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167601 
Responsible-Changed-From-To: itetcu->crees 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Mar 25 01:22:53 UTC 2014 
Responsible-Changed-Why:  
Over to new maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167601 
State-Changed-From-To: open->closed 
State-Changed-By: crees 
State-Changed-When: Tue Mar 25 20:49:45 UTC 2014 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167601 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/167601: commit references a PR
Date: Tue, 25 Mar 2014 20:49:29 +0000 (UTC)

 Author: crees
 Date: Tue Mar 25 20:49:20 2014
 New Revision: 349193
 URL: http://svnweb.freebsd.org/changeset/ports/349193
 QAT: https://qat.redports.org/buildarchive/r349193/
 
 Log:
   Fix enterBuild-- also fixed upstream
   
   PR:		ports/184943
   Submitted by:	Anes Mukhametov <anes@anes.su>
   
   Allow masking of PHP use and markup logs
   
   PR:		ports/167601
   Submitted by:	Jarrod Sayers <jarrod@downtools.com.au>
 
 Added:
   head/ports-mgmt/tinderbox/files/patch-enterbuild   (contents, props changed)
 Modified:
   head/ports-mgmt/tinderbox/Makefile
 
 Modified: head/ports-mgmt/tinderbox/Makefile
 ==============================================================================
 --- head/ports-mgmt/tinderbox/Makefile	Tue Mar 25 20:34:56 2014	(r349192)
 +++ head/ports-mgmt/tinderbox/Makefile	Tue Mar 25 20:49:20 2014	(r349193)
 @@ -3,6 +3,7 @@
  
  PORTNAME=	tinderbox
  PORTVERSION=	4.1.0
 +PORTREVISION=	1
  CATEGORIES=	ports-mgmt
  MASTER_SITES=	http://tinderbox.marcuscom.com/ \
  		http://T32.TecNik93.com/FreeBSD/ports/${PORTNAME}/sources/
 @@ -21,7 +22,7 @@ OPTIONS_MULTI_DB=	PGSQL MYSQL SQLITE
  OPTIONS_RADIO=		WEB
  OPTIONS_RADIO_WEB=	APACHE HIAWATHA LIGHTTPD NGINX
  
 -OPTIONS_DEFINE=		CHECK_ROOT EMAILS LSOF LOG_COMPRESS
 +OPTIONS_DEFINE=		CHECK_ROOT EMAILS LSOF LOG_COMPRESS HIDE_PHP HIDE_MARKUP
  
  CHECK_ROOT_DESC=	Check if ./tc is run by uid 0
  EMAILS_DESC=		Support for build failure/completion emails
 @@ -29,6 +30,8 @@ LSOF_DESC=		For killMountProcesses() whe
  LOG_COMPRESS_DESC=	Support bzip log compression
  HIAWATHA_DESC=		Hiawatha server
  NGINX_DESC=		Nginx server
 +HIDE_PHP_DESC=		Hide index.php in webui templates
 +HIDE_MARKUP_DESC=	Hide display_markup_log action
  
  OPTIONS_DEFAULT=	MYSQL APACHE CHECK_ROOT EMAILS LSOF \
  			LOG_COMPRESS
 @@ -101,6 +104,18 @@ post-patch:
  	${REINPLACE_CMD} -e 's/^if \[ `id -u` != 0 \]; then/if false; then/' \
  		${WRKSRC}/tc
  .endif
 +.if defined(WEBUI)
 +.  if ${PORT_OPTIONS:MHIDE_PHP}
 +	@${REINPLACE_CMD} -e 's#index.php\?#\?#g;s#index.php#\?#g' \
 +		${WRKSRC}/webui/templates/*/*.tpl
 +.  endif
 +.  if ${PORT_OPTIONS:MHIDE_MARKUP}
 +	@${REINPLACE_CMD} -e 's#<a href="[^"]*">markup</a>#markup#g' \
 +			  -e 's#>markup_log.*;#>markup_log(-1,-1)#g' \
 +		${WRKSRC}/webui/templates/*/*.tpl ${WRKSRC}/webui/index.php
 +.  endif
 +.endif
 +	@${FIND} ${WRKSRC} -name '*.orig' -or -name '*.bak' -delete
  
  do-install:
  	@${MKDIR} ${STAGEDIR}${PREFIX}/tinderbox/scripts
 
 Added: head/ports-mgmt/tinderbox/files/patch-enterbuild
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/ports-mgmt/tinderbox/files/patch-enterbuild	Tue Mar 25 20:49:20 2014	(r349193)
 @@ -0,0 +1,17 @@
 +diff -u lib/tc_command.sh.orig lib/tc_command.sh
 +--- lib/tc_command.sh.orig
 ++++ lib/tc_command.sh
 +@@ -1284,11 +1284,12 @@ enterBuild () {
 + 	return 1
 +     fi
 + 
 ++    tc=$(tinderLoc scripts tc)
 +     portstree=$(${tc} getPortsTreeForBuild -b ${build})
 +     sleepName=$(echo ${portDir} | sed -e 'y/\//_/')
 +     buildPortFullDir=${buildRoot}/usr/ports/${portDir}
 +     portsTreeDir=$(tinderLoc portstree ${portstree})
 +-    portFullDir=${portsTreeDir}/${portDir}
 ++    portFullDir=${portsTreeDir}/ports/${portDir}
 + 
 +     if [ ! -d ${portFullDir} ]; then
 + 	echo "enterBuild: Build environment does not exist yet, sleeping."
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/167601: commit references a PR
Date: Mon,  7 Apr 2014 18:02:21 +0000 (UTC)

 Author: crees
 Date: Mon Apr  7 18:02:17 2014
 New Revision: 350530
 URL: http://svnweb.freebsd.org/changeset/ports/350530
 QAT: https://qat.redports.org/buildarchive/r350530/
 
 Log:
   Fix with HIDE_MARKUP option
   
   PR:		ports/167601
   Submitted by:	Jarrod Sayers
 
 Modified:
   head/ports-mgmt/tinderbox/Makefile
 
 Modified: head/ports-mgmt/tinderbox/Makefile
 ==============================================================================
 --- head/ports-mgmt/tinderbox/Makefile	Mon Apr  7 17:43:20 2014	(r350529)
 +++ head/ports-mgmt/tinderbox/Makefile	Mon Apr  7 18:02:17 2014	(r350530)
 @@ -111,7 +111,7 @@ post-patch:
  .  endif
  .  if ${PORT_OPTIONS:MHIDE_MARKUP}
  	@${REINPLACE_CMD} -e 's#<a href="[^"]*">markup</a>#markup#g' \
 -			  -e 's#>markup_log.*;#>markup_log(-1,-1)#g' \
 +			  -e 's#>markup_log.*;#>markup_log(-1,-1);#g' \
  		${WRKSRC}/webui/templates/*/*.tpl ${WRKSRC}/webui/index.php
  .  endif
  .endif
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
