Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111385845
D6349.id16295.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6349.id16295.diff
View Options
Index: Mk/bsd.port.mk
===================================================================
--- Mk/bsd.port.mk
+++ Mk/bsd.port.mk
@@ -5246,7 +5246,8 @@
@${ECHO_MSG} "===> No options to configure"
.else
@optionsdir=${OPTIONS_FILE:H}; \
- if [ ${UID} != 0 -a -z "${INSTALL_AS_USER}" -a ! -w "${PORT_DBDIR}" ] ; then \
+ if [ ! -w "${PORT_DBDIR}" -a "`stat -f %u ${PORT_DBDIR:H}`" = 0 ]; \
+ then \
${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \
(${SU_CMD} "${SH} -c \"${MKDIR} $${optionsdir} 2> /dev/null\"") || \
(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
@@ -5282,7 +5283,8 @@
${ECHO_CMD} "OPTIONS_FILE_UNSET+=$${i}" >> $${TMPOPTIONSFILE}; \
fi; \
done; \
- if [ ${UID} != 0 -a -z "${INSTALL_AS_USER}" -a ! -w "${OPTIONS_FILE:H}" ]; then \
+ if [ ! -w "${OPTIONS_FILE:H}" -a "`stat -f %u ${OPTIONS_FILE:H}`" != ${UID} ]; \
+ then \
${ECHO_MSG} "===> Switching to root credentials to write ${OPTIONS_FILE}"; \
${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${OPTIONS_FILE}"; \
${ECHO_MSG} "===> Returning to user credentials"; \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 4, 3:19 AM (13 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16960347
Default Alt Text
D6349.id16295.diff (1 KB)
Attached To
Mode
D6349: Fix "need root" logic for PORT_DBDIR.
Attached
Detach File
Event Timeline
Log In to Comment