ports/138355: net/freeradius2 can't install from package when /usr/ports mounted RO

Dan Lukes dan at obluda.cz
Sun Aug 30 18:40:06 UTC 2009


>Number:         138355
>Category:       ports
>Synopsis:       net/freeradius2 can't install from package when /usr/ports mounted RO
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 30 18:40:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Dan Lukes
>Release:        FreeBSD
>Organization:
Obludarium
>Environment:
System: FreeBSD 7.2-STABLE
but exact FreeBSD version is not relevant

net/freeradius2/files/pkg-install.in,v 1.4 2009/04/22 16:28:18

>Description:
	net/freeradius2 can't be instaled from package when /usr/ports tree
present && net/freeradius2/work/radiusd.conf exist && /usr/ports tree mouted
read-only

	It's not artifical scenario. Imagine central distribution point where all
required ports are compiled with apropriate options and packages are created 

	the /usr/ports tree from repository is read-only mounted 
to other machine. Here the packages are installed from /usr/ports/packages/All
	

>How-To-Repeat:
   Prolog:
	create package of net/freeradius2 port
	working directory of the port MUST NOT be deleted
         (e.g. /usr/ports/net/freeradius2/work/radiusd.conf still exist)
	deinstall net/freeradius2
	
   Now you:
	mount /usr/ports tree as read-only
	install net/freeradis2 from package

	the installation will fail because install script will fail because the
/usr/ports/net/freeradius2/work/radiusd.conf exists, but not writable

>Fix:

	Patch writable files only:

--- patch-FREERADIUS2 begins here ---
--- net/freeradius2/files/pkg-install.in.orig	2009-08-30 19:22:27.000000000 +0200
+++ net/freeradius2/files/pkg-install.in	2009-08-30 19:23:07.000000000 +0200
@@ -104,7 +104,7 @@
         # Fix the user and group in raddb/radiusd.conf
 	echo "===> Setting user and group in radiusd.conf"
 	for file in ${radius_raddb_work}/radiusd.conf ${radius_raddb}/radiusd.conf; do
-	    if [ -f ${file} ]; then
+	    if [ -w ${file} ]; then
 		if ! sed -Ee "s/^[[:space:]#]*(user[[:space:]]*=[[:space:]]*).*$/\1${radius_user}/" \
 		    -e "s/^[[:space:]#]*(group[[:space:]]*=[[:space:]]*).*$/\1${radius_group}/" \
 		    -i .orig ${file}; then
--- patch-FREERADIUS2 ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list