This is a necessary piece to turn things on. Basically, the check makes sure that after the possible SUDO barrier, the resulting umask is 022, as it should. Well, if there's no sudo, the original umask carries over, so let's insist on having umask 022 beforehand in the actual install cases during the fake stage...
(remember that umask is a shell internal, so this will incur about 0 performance loss) Index: bsd.port.mk =================================================================== RCS file: /build/data/openbsd/cvs/ports/infrastructure/mk/bsd.port.mk,v retrieving revision 1.1280 diff -u -p -r1.1280 bsd.port.mk --- bsd.port.mk 5 Sep 2014 14:45:02 -0000 1.1280 +++ bsd.port.mk 8 Sep 2014 07:51:43 -0000 @@ -2819,7 +2819,7 @@ _hook-post-install:: ${_FAKE_COOKIE}: ${_BUILD_COOKIE} @${ECHO_MSG} "===> Faking installation for ${FULLPKGNAME}${_MASTER}" - @if [ x`${_FAKESUDO} /bin/sh -c umask` != x022 ]; then \ + @if [ x`umask 022;${_FAKESUDO} /bin/sh -c umask` != x022 ]; then \ echo >&2 "Error: your umask is \"`${_FAKESUDO} /bin/sh -c umask`"\".; \ exit 1; \ fi @@ -2851,7 +2851,7 @@ ${_FAKE_COOKIE}: ${_BUILD_COOKIE} @${_SUDOMAKESYS} do-install ${FAKE_SETUP} .else # What FAKE normally does: - @cd ${WRKBUILD} && exec ${_FAKESUDO} ${_SYSTRACE_CMD} \ + @cd ${WRKBUILD} && umask 022 && exec ${_FAKESUDO} ${_SYSTRACE_CMD} \ ${SETENV} ${MAKE_ENV} ${FAKE_SETUP} \ ${MAKE_PROGRAM} ${ALL_FAKE_FLAGS} -f ${MAKE_FILE} ${FAKE_TARGET} # End of FAKE. Index: pkgpath.mk =================================================================== RCS file: /build/data/openbsd/cvs/ports/infrastructure/mk/pkgpath.mk,v retrieving revision 1.57 diff -u -p -r1.57 pkgpath.mk --- pkgpath.mk 10 Aug 2014 08:59:48 -0000 1.57 +++ pkgpath.mk 8 Sep 2014 07:51:43 -0000 @@ -123,7 +123,7 @@ _cache_fragment = \ _MAKE = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${MAKE} _SUDOMAKE = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${SUDO} ${MAKE} _MAKESYS = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${_SYSTRACE_CMD} ${MAKE} -_SUDOMAKESYS = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${_FAKESUDO} ${_SYSTRACE_CMD} ${MAKE} +_SUDOMAKESYS = cd ${.CURDIR} && umask 022 && PKGPATH=${PKGPATH} exec ${_FAKESUDO} ${_SYSTRACE_CMD} ${MAKE} REPORT_PROBLEM_LOGFILE ?= .if !empty(REPORT_PROBLEM_LOGFILE)