From nobody@FreeBSD.org  Mon Dec 11 21:00:26 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 022BB16A4D2
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Dec 2006 21:00:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 536C044387
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Dec 2006 20:35:50 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id kBBKax6n097217
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Dec 2006 20:36:59 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id kBBKaxc8097214;
	Mon, 11 Dec 2006 20:36:59 GMT
	(envelope-from nobody)
Message-Id: <200612112036.kBBKaxc8097214@www.freebsd.org>
Date: Mon, 11 Dec 2006 20:36:59 GMT
From: "Steffen M. Boelaars"<boelaars@flatrock.eu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Default file modes set incorrect for non-root port installs
X-Send-Pr-Version: www-3.0

>Number:         106616
>Category:       ports
>Synopsis:       bsd.port.mk: Default file modes set incorrect for non-root port installs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          suspended
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 11 21:10:10 GMT 2006
>Closed-Date:    
>Last-Modified:  Fri May 25 03:39:05 GMT 2007
>Originator:     Steffen M. Boelaars
>Release:        6.0-RELEASE
>Organization:
Flat Rock ICT Services
>Environment:
FreeBSD hidden.hidden 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Mon Dec 12 23:29:47 CET 2005     hidden@hidden.hidden:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
The default values for BINMODE/SHAREMODE/MANMODE are incorrect when installing ports as a non-root user. Value 444 is used, which means that any file installed, can then not be changed by any following command. This problem does not occur for root, because root doesn't care about file permissions.
>How-To-Repeat:
Do an install as non-root user of for example converters/libiconv (see the article on my webpage for pointers on how this works: http://www.white-russian.nl/?page=/blog/2006/07/installing_free.html )

If the SHAREMODE var is not specificaly set in the environment it will not work. It makes sense to have this situation properly recognised by the ports mechanism.
>Fix:
Apply the following patch:

--- /usr/ports/Mk/bsd.port.mk   Sat Sep 30 21:25:45 2006
+++ /home/users/whiter/ports/Mk/bsd.port.mk     Mon Dec 11 21:35:35 2006
@@ -2248,6 +2248,9 @@
 _BINOWNGRP=
 _SHROWNGRP=
 _MANOWNGRP=
+BINMODE?=644
+SHAREMODE?=644
+MANMODE?=644
 .endif

 # A few aliases for *-install targets

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: shaun 
Responsible-Changed-When: Mon Dec 11 22:45:14 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer(s). 

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

From: "Steffen M. Boelaars" <boelaars@flatrock.eu>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/106616: bsd.port.mk: Default file modes set incorrect 
     for non-root port installs
Date: Tue, 12 Dec 2006 00:35:49 +0100 (CET)

 The BINMODE line in the patch should ofcourse read
 BINMODE?=744
 or something similar with atleast a 7 for the user mode.
State-Changed-From-To: open->suspended 
State-Changed-By: linimon 
State-Changed-When: Fri May 25 03:37:10 UTC 2007 
State-Changed-Why:  
At the portmgr meeting at BSDCan 2007, we decided that this solution is 
too heavyweight.  This may work too hard at overriding legitimate usages 
in ports.  Perhaps this should be wrapped in a test for UID 0?  In any 
case, this needs further thought before we test it as a patch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106616 
>Unformatted:
