Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jul 2016 19:42:19 +0000 (UTC)
From:      Mark Felder <feld@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r418198 - in branches/2016Q3/net-mgmt/nfsen: . files
Message-ID:  <201607071942.u67JgJwB099449@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: feld
Date: Thu Jul  7 19:42:19 2016
New Revision: 418198
URL: https://svnweb.freebsd.org/changeset/ports/418198

Log:
  MFH: r418197
  
  net-mgmt/nfsen: Improve default directory permissions
  
  Also make it easier to install/run as another user.
  
  PR:		210368
  
  Approved by:	ports-secteam (with hat)

Modified:
  branches/2016Q3/net-mgmt/nfsen/Makefile
  branches/2016Q3/net-mgmt/nfsen/files/nfsen.in
  branches/2016Q3/net-mgmt/nfsen/pkg-plist
Directory Properties:
  branches/2016Q3/   (props changed)

Modified: branches/2016Q3/net-mgmt/nfsen/Makefile
==============================================================================
--- branches/2016Q3/net-mgmt/nfsen/Makefile	Thu Jul  7 19:41:31 2016	(r418197)
+++ branches/2016Q3/net-mgmt/nfsen/Makefile	Thu Jul  7 19:42:19 2016	(r418198)
@@ -3,7 +3,7 @@
 
 PORTNAME=	nfsen
 PORTVERSION=	1.3.7
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	net-mgmt
 MASTER_SITES=	SF/${PORTNAME}/stable/${PORTNAME}-${PORTVERSION} \
 		http://nfsen.sourceforge.net/
@@ -25,7 +25,9 @@ CPE_PRODUCT=	nfsen
 USE_PHP=	session pcre sockets
 NO_BUILD=	yes
 NO_ARCH=	yes
+NFSENOWN?=	www
 PLIST_SUB+=	PORTNAME=${PORTNAME}
+PLIST_SUB+=	NFSENOWN=${NFSENOWN}
 USE_RC_SUBR=	nfsen
 perl_OLD_CMD=	%%PERL%%
 SHEBANG_FILES=	bin/testPlugin bin/RebuildHierarchy.pl bin/nfsen bin/nfsend libexec/NfSenRRD.pm \
@@ -40,6 +42,7 @@ SUB_LIST+=	"PORTVERSION=${PORTVERSION}"
 SUB_LIST+=	"PREFIX=${PREFIX}"
 SUB_LIST+=	"WWWDIR=${WWWDIR}"
 SUB_LIST+=	"PORTNAME=${PORTNAME}"
+SUB_LIST+=	"NFSENOWN=${NFSENOWN}"
 
 post-patch:
 .for nfsenfile in ${REINPLACE_LIST}
@@ -52,6 +55,8 @@ post-patch:
 	@${REINPLACE_CMD} ${_SUB_LIST_TEMP} ${WRKSRC}/conf.php
 	@${REINPLACE_CMD} "s|/usr/bin/perl|${perl_CMD}|" ${WRKSRC}/libexec/Nfcomm.pm
 
+FIND_EXPR=	! -name \._* -prune
+
 do-install:
 	${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/profiles-data/live
 	${INSTALL} -d ${STAGEDIR}/${PREFIX}/var/${PORTNAME}/profiles-stat/live
@@ -62,10 +67,10 @@ do-install:
 	${INSTALL} -d ${STAGEDIR}/${WWWDIR}/plugins
 	(cd ${WRKSRC}/bin && ${INSTALL_SCRIPT} * ${STAGEDIR}/${PREFIX}/bin/)
 	${INSTALL_DATA} ${WRKSRC}/etc/nfsen-dist.conf ${STAGEDIR}/${PREFIX}/etc/
-	(cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/)
-	(cd ${WRKSRC}/plugins/frontend/ && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/plugins/)
+	(cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/ "${FIND_EXPR}")
+	(cd ${WRKSRC}/plugins/frontend/ && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/plugins/ "${FIND_EXPR}")
 	(cd ${WRKSRC}/libexec && ${INSTALL_SCRIPT} * ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/)
-	(cd ${WRKSRC}/plugins/backend && ${COPYTREE_SHARE} . ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/plugins/)
+	(cd ${WRKSRC}/plugins/backend && ${COPYTREE_SHARE} . ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/plugins/ "${FIND_EXPR}")
 	${INSTALL_DATA} ${WRKSRC}/installer-items/CopyRecursive.pm ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/
 	${INSTALL_DATA} ${WRKSRC}/installer-items/RRDconvertv1.pm ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/
 	${INSTALL_DATA} ${WRKSRC}/conf.php ${STAGEDIR}/${WWWDIR}

Modified: branches/2016Q3/net-mgmt/nfsen/files/nfsen.in
==============================================================================
--- branches/2016Q3/net-mgmt/nfsen/files/nfsen.in	Thu Jul  7 19:41:31 2016	(r418197)
+++ branches/2016Q3/net-mgmt/nfsen/files/nfsen.in	Thu Jul  7 19:42:19 2016	(r418198)
@@ -15,6 +15,7 @@ load_rc_config $name
 
 nfsen_enable=${nfsen_enable-"NO"}
 #nfsen_flags=${nfsen_flags-""}
+nfsen_user=${nfsen_user-"%%NFSENOWN%%"}
 
 command="%%PREFIX%%/bin/nfsen"
 start_cmd="%%PREFIX%%/bin/nfsen start"
@@ -34,6 +35,7 @@ nfsen_start_precmd()
 	if [ ! -e %%PREFIX%%/var/nfsen/profiles-stat/live/profile.dat ]; then
 		time=$(/bin/date +%s);
 		timeu=$(/bin/expr $time - 300);
+		profile_dat=%%PREFIX%%/var/nfsen/profiles-stat/live/profile.dat
 		/usr/bin/printf "name = live
 		group = .
 		tbegin = $time
@@ -47,7 +49,8 @@ nfsen_start_precmd()
 		type = 0
 		locked = 0
 		status = OK
-		version = 130" | /usr/bin/tr -d '\011' > %%PREFIX%%/var/nfsen/profiles-stat/live/profile.dat;
+		version = 130" | /usr/bin/tr -d '\011' > ${profile_dat}
+		chown ${nfsen_user} ${profile_dat}
 	fi
 }
 

Modified: branches/2016Q3/net-mgmt/nfsen/pkg-plist
==============================================================================
--- branches/2016Q3/net-mgmt/nfsen/pkg-plist	Thu Jul  7 19:41:31 2016	(r418197)
+++ branches/2016Q3/net-mgmt/nfsen/pkg-plist	Thu Jul  7 19:42:19 2016	(r418198)
@@ -74,13 +74,13 @@ libexec/%%PORTNAME%%/AbuseWhois.pm
 %%WWWDIR%%/colour_picker.html
 %%WWWDIR%%/colour_palette.html
 %%WWWDIR%%/alerting.php
-@dir var/%%PORTNAME%%/run
-@dir var/%%PORTNAME%%/profiles-stat/live
-@dir var/%%PORTNAME%%/profiles-stat
-@dir var/%%PORTNAME%%/profiles-data/live
-@dir var/%%PORTNAME%%/profiles-data
-@dir var/%%PORTNAME%%/profiles/live
-@dir var/%%PORTNAME%%/profiles
-@dir var/%%PORTNAME%%/filters
-@dir var/%%PORTNAME%%
+@dir(%%NFSENOWN%%,,) var/%%PORTNAME%%/run
+@dir(%%NFSENOWN%%,,) var/%%PORTNAME%%/profiles-stat/live
+@dir(%%NFSENOWN%%,,) var/%%PORTNAME%%/profiles-stat
+@dir(%%NFSENOWN%%,,) var/%%PORTNAME%%/profiles-data/live
+@dir(%%NFSENOWN%%,,) var/%%PORTNAME%%/profiles-data
+@dir(%%NFSENOWN%%,,) var/%%PORTNAME%%/profiles/live
+@dir(%%NFSENOWN%%,,) var/%%PORTNAME%%/profiles
+@dir(%%NFSENOWN%%,,) var/%%PORTNAME%%/filters
+@dir(%%NFSENOWN%%,,) var/%%PORTNAME%%
 @dir var



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