FreeBSD Bugzilla – Attachment 163724 Details for
Bug 204946
[patch] www/tinyproxy: Use separate user and group, add newsyslog config
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Dedicated tinyproxy user and group, newsyslog config
tinyproxy.patch (text/plain), 8.21 KB, created by
TEUBEL György
on 2015-12-01 19:56:59 UTC
(
hide
)
Description:
Dedicated tinyproxy user and group, newsyslog config
Filename:
MIME Type:
Creator:
TEUBEL György
Created:
2015-12-01 19:56:59 UTC
Size:
8.21 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 402666) >+++ Makefile (working copy) >@@ -3,7 +3,7 @@ > > PORTNAME= tinyproxy > PORTVERSION= 1.8.3 >-PORTREVISION= 1 >+PORTREVISION= 2 > PORTEPOCH= 1 > CATEGORIES= www > MASTER_SITES= https://banu.com/pub/tinyproxy/${PORTVERSION:R}/ \ >@@ -15,11 +15,6 @@ > LICENSE= GPLv2 GPLv3 > LICENSE_COMB= dual > >-OPTIONS_DEFINE= REVERSE TRANSPARENT XHEADER >-REVERSE_DESC= Reverse proxy support >-TRANSPARENT_DESC= Transparent proxy support >-XHEADER_DESC= X-Tinyproxy header >- > CONFIGURE_ARGS= --bindir=${PREFIX}/sbin \ > --disable-silent-rules \ > --program-transform-name="" >@@ -27,21 +22,42 @@ > USE_RC_SUBR= ${PORTNAME} > USES= gmake > >+TINYPROXY_USER= tinyproxy >+TINYPROXY_GROUP= tinyproxy >+USERS= ${TINYPROXY_USER} >+GROUPS= ${TINYPROXY_GROUP} >+ >+SUB_LIST+= TINYPROXY_USER=${TINYPROXY_USER} TINYPROXY_GROUP=${TINYPROXY_GROUP} >+SUB_FILES+= tinyproxy.newsyslog >+ >+PLIST_SUB+= TINYPROXY_USER=${TINYPROXY_USER} TINYPROXY_GROUP=${TINYPROXY_GROUP} >+ >+OPTIONS_DEFINE= REVERSE TRANSPARENT XHEADER >+REVERSE_DESC= Reverse proxy support >+TRANSPARENT_DESC= Transparent proxy support >+XHEADER_DESC= X-Tinyproxy header >+ > REVERSE_CONFIGURE_ENABLE= reverse > TRANSPARENT_CONFIGURE_ENABLE= transparent > XHEADER_CONFIGURE_ENABLE= xtinyproxy > >+pre-patch: >+ @${MV} ${WRKSRC}/etc/tinyproxy.conf.in \ >+ ${WRKSRC}/etc/tinyproxy.conf.sample.in >+ > post-patch: >- @${REINPLACE_CMD} -e 's|-O2||' ${WRKSRC}/configure >- @${REINPLACE_CMD} -e 's|tinyproxy/tinyproxy|tinyproxy|g; s|/etc/tinyproxy|${PREFIX}&|' \ >- ${WRKSRC}/docs/man5/tinyproxy.conf.txt.in \ >- ${WRKSRC}/docs/man8/tinyproxy.txt.in \ >- ${WRKSRC}/etc/tinyproxy.conf.in >- @${REINPLACE_CMD} -e '/\/usr\/share\/tinyproxy/d' ${WRKSRC}/etc/tinyproxy.conf.in >+ @${REINPLACE_CMD} -e '/\/usr\/share\/tinyproxy/d' \ >+ -e 's|/etc/tinyproxy|${PREFIX}&|' \ >+ -e 's|User nobody|User ${TINYPROXY_USER}|' \ >+ -e 's|Group nobody|Group ${TINYPROXY_GROUP}|' \ >+ ${WRKSRC}/etc/tinyproxy.conf.sample.in > > post-install: >- ${INSTALL_DATA} ${WRKSRC}/etc/tinyproxy.conf ${STAGEDIR}${PREFIX}/etc/tinyproxy.conf.sample > ${INSTALL_MAN} ${FILESDIR}/tinyproxy.conf.5 ${STAGEDIR}${PREFIX}/man/man5/ > ${INSTALL_MAN} ${FILESDIR}/tinyproxy.8 ${STAGEDIR}${PREFIX}/man/man8/ >+ ${INSTALL_DATA} ${WRKDIR}/tinyproxy.newsyslog \ >+ ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/tinyproxy.conf >+ ${MKDIR} ${STAGEDIR}/var/log/tinyproxy >+ ${MKDIR} ${STAGEDIR}/var/run/tinyproxy > > .include <bsd.port.mk> >Index: files/patch-etc-Makefile.in >=================================================================== >--- files/patch-etc-Makefile.in (revision 402666) >+++ files/patch-etc-Makefile.in (working copy) >@@ -1,15 +1,33 @@ >---- etc/Makefile.in.orig 2011-08-16 12:27:58 UTC >+--- etc/Makefile.in.orig 2015-11-19 19:45:17 UTC > +++ etc/Makefile.in >-@@ -248,8 +248,10 @@ install-sysconfDATA: $(sysconf_DATA) >- echo "$$d$$p"; \ >- done | $(am__base_list) | \ >- while read files; do \ >-- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \ >-- $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ >-+ nfile="$$files.sample"; \ >-+ cp $$files $$nfile; \ >-+ echo " $(INSTALL_DATA) $$nfile '$(DESTDIR)$(sysconfdir)'"; \ >-+ $(INSTALL_DATA) $$nfile "$(DESTDIR)$(sysconfdir)" || exit $$?; \ >- done >+@@ -188,10 +188,10 @@ top_build_prefix = @top_build_prefix@ >+ top_builddir = @top_builddir@ >+ top_srcdir = @top_srcdir@ >+ sysconf_DATA = \ >+- tinyproxy.conf >++ tinyproxy.conf.sample > >- uninstall-sysconfDATA: >+ EXTRA_DIST = \ >+- tinyproxy.conf.in >++ tinyproxy.conf.sample.in >+ >+ edit = sed \ >+ -e 's|@bindir[@]|$(bindir)|g' \ >+@@ -204,7 +204,7 @@ edit = sed \ >+ -e 's|@TINYPROXY_STATHOST[@]|$(TINYPROXY_STATHOST)|g' >+ >+ CLEANFILES = \ >+- tinyproxy.conf >++ tinyproxy.conf.sample >+ >+ all: all-am >+ >+@@ -409,7 +409,7 @@ uninstall-am: uninstall-sysconfDATA >+ uninstall-am uninstall-sysconfDATA >+ >+ >+-tinyproxy.conf: $(top_srcdir)/etc/tinyproxy.conf.in Makefile >++tinyproxy.conf.sample: $(top_srcdir)/etc/tinyproxy.conf.sample.in Makefile >+ @rm -f $@ $@.tmp >+ $(AM_V_GEN) $(edit) $(top_srcdir)/etc/$@.in > $@.tmp >+ @mv $@.tmp $@ >Index: files/patch-src-main.c >=================================================================== >--- files/patch-src-main.c (revision 402666) >+++ files/patch-src-main.c (nonexistent) >@@ -1,32 +0,0 @@ >---- src/main.c.orig 2011-08-16 12:14:34 UTC >-+++ src/main.c >-@@ -407,12 +407,9 @@ main (int argc, char **argv) >- exit (EX_OSERR); >- } >- >-- /* Switch to a different user if we're running as root */ >-- if (geteuid () == 0) >-- change_user (argv[0]); >-- else >-- log_message (LOG_WARNING, >-- "Not running as root, so not changing UID/GID."); >-+ /*To get this to run correctly on FreeBSD, we must >-+ ceate the PID and log files before we drop privileges. >-+ Other ideas are welcome */ >- >- /* Create log file after we drop privileges */ >- if (setup_logging ()) { >-@@ -427,6 +424,13 @@ main (int argc, char **argv) >- exit (EX_OSERR); >- } >- } >-+ /* Switch to a different user if we're running as root */ >-+ if (geteuid () == 0) >-+ change_user (argv[0]); >-+ else >-+ log_message (LOG_WARNING, >-+ "Not running as root, so not changing UID/GID."); >-+ >- >- if (child_pool_create () < 0) { >- fprintf (stderr, > >Property changes on: files/patch-src-main.c >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: files/tinyproxy.8 >=================================================================== >--- files/tinyproxy.8 (revision 402666) >+++ files/tinyproxy.8 (working copy) >@@ -144,7 +144,7 @@ > The stat file template can be changed at runtime through the configuration variable StatFile\&. > .SH "FILES" > .sp >-/usr/local/etc/tinyproxy\&.conf, /var/run/tinyproxy\&.pid, /var/log/tinyproxy\&.log >+/usr/local/etc/tinyproxy\&.conf, /var/run/tinyproxy/tinyproxy\&.pid, /var/log/tinyproxy/tinyproxy\&.log > .SH "BUGS" > .sp > To report bugs in Tinyproxy, please visit <https://www\&.banu\&.com/tinyproxy/>\&. >Index: files/tinyproxy.in >=================================================================== >--- files/tinyproxy.in (revision 402666) >+++ files/tinyproxy.in (working copy) >@@ -19,11 +19,12 @@ > > # Make sure the pidfile matches what's in the config file. > : ${tinyproxy_enable="NO"} >-: ${tinyproxy_pidfile="/var/run/tinyproxy.pid"} >+: ${tinyproxy_pidfile="/var/run/tinyproxy/tinyproxy.pid"} > : ${tinyproxy_config="%%PREFIX%%/etc/tinyproxy.conf"} > >-pidfile=${tinyproxy_pidfile} >+required_files="${tinyproxy_config}" >+pidfile="${tinyproxy_pidfile}" > command=%%PREFIX%%/sbin/tinyproxy >-command_args="-c $tinyproxy_config 2> /dev/null" >+command_args="-c ${tinyproxy_config} 2> /dev/null" > > run_rc_command "$1" >Index: files/tinyproxy.newsyslog.in >=================================================================== >--- files/tinyproxy.newsyslog.in (nonexistent) >+++ files/tinyproxy.newsyslog.in (working copy) >@@ -0,0 +1,2 @@ >+# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] >+/var/log/tinyproxy/tinyproxy.log %%TINYPROXY_USER%%:%%TINYPROXY_GROUP%% 600 7 * @T00 J /var/run/tinyproxy/tinyproxy.pid > >Property changes on: files/tinyproxy.newsyslog.in >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: pkg-plist >=================================================================== >--- pkg-plist (revision 402666) >+++ pkg-plist (working copy) >@@ -1,4 +1,5 @@ > @sample etc/tinyproxy.conf.sample >+etc/newsyslog.conf.d/tinyproxy.conf > man/man5/tinyproxy.conf.5.gz > man/man8/tinyproxy.8.gz > sbin/tinyproxy >@@ -5,3 +6,5 @@ > %%DATADIR%%/debug.html > %%DATADIR%%/default.html > %%DATADIR%%/stats.html >+@dir(%%TINYPROXY_USER%%,%%TINYPROXY_GROUP%%,) /var/log/tinyproxy >+@dir(%%TINYPROXY_USER%%,%%TINYPROXY_GROUP%%,) /var/run/tinyproxy
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 204946
: 163724