Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Sep 2010 06:31:12 +0400
From:      Anonymous <swell.k@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/150611: [patch] lang/perl5.12: preserve permissions for make.conf and manpath.config
Message-ID:  <861v8uo1vy.fsf@gmail.com>
Resent-Message-ID: <201009160240.o8G2e32k057372@freefall.freebsd.org>

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

>Number:         150611
>Category:       ports
>Synopsis:       [patch] lang/perl5.12: preserve permissions for make.conf and manpath.config
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 16 02:40:02 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
__MAKE_CONF=$HOME/.make.conf
>Description:
Currently use.perl script resets permissions to default (umask + group)
when spamming in make.conf or manpath.config. This may causes
inconvenience for non-root user with his own make.conf as well as reduce
security if the files had more restrictive permissions before editing.
>How-To-Repeat:
- use user-owned make.conf and install the port with SU_CMD
- use non-default permissions (non-umask, ACLs, file flags, etc.)
>Fix:
--- a.diff begins here ---
Index: lang/perl5.12/files/use.perl
===================================================================
RCS file: /a/.cvsup/ports/lang/perl5.12/files/use.perl,v
retrieving revision 1.15
diff -u -p -r1.15 use.perl
--- lang/perl5.12/files/use.perl	5 Nov 2009 18:50:45 -0000	1.15
+++ lang/perl5.12/files/use.perl	16 Sep 2010 01:48:40 -0000
@@ -95,6 +95,7 @@ do_cleanup_make_conf()
 {
 	echo -n "Cleaning up ${MAKE_CONF}..."
 	if [ -f ${MAKE_CONF} ] ; then
+		/bin/cp -p ${MAKE_CONF} ${MAKE_CONF}.new
 		/usr/bin/awk 's=0;
 			/^#.*use.perl/ { s=1; mode=1 }
 			/^#/ { s=1; if (mode != 1) { mode=0 } }
@@ -111,6 +112,7 @@ do_cleanup_manpath()
 {
 	echo -n "Cleaning up /etc/manpath.config..."
 	if [ -f /etc/manpath.config ] ; then
+		/bin/cp -p /etc/manpath.config /etc/manpath.config.new
 		/usr/bin/awk 's=0;
 			/^#.*use.perl/ { s=1; mode=1 }
 			/^#/ { s=1; if (mode != 1) { mode=0 } }
--- a.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?861v8uo1vy.fsf>