Bug 106616 - bsd.port.mk: Default file modes set incorrect for non-root port installs
Summary: bsd.port.mk: Default file modes set incorrect for non-root port installs
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-11 21:10 UTC by boelaars
Modified: 2015-06-12 21:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description boelaars 2006-12-11 21:10:10 UTC
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.

Fix: Apply the following patch:



# A few aliases for *-install targets--Osy7cCbHyghnOtHtSIlUcVmixSmJeNyTG1XAVdPuiXX8Qm2a
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- /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
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.
Comment 1 Shaun Amott freebsd_committer freebsd_triage 2006-12-11 22:45:14 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Over to maintainer(s).
Comment 2 boelaars 2006-12-11 23:35:49 UTC
The BINMODE line in the patch should ofcourse read
BINMODE?=744
or something similar with atleast a 7 for the user mode.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2007-05-25 04:37:10 UTC
State Changed
From-To: open->suspended

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.