force umask 022 in fake !sudo situations.

This commit is contained in:
espie 2014-09-09 09:34:04 +00:00
parent e9dee92978
commit c5fc4eddea
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#-*- mode: Makefile; tab-width: 4; -*-
# ex:ts=4 sw=4 filetype=make:
# $OpenBSD: bsd.port.mk,v 1.1280 2014/09/05 14:45:02 jasper Exp $
# $OpenBSD: bsd.port.mk,v 1.1281 2014/09/09 09:34:04 espie Exp $
#
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
@ -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.

View File

@ -1,4 +1,4 @@
# $OpenBSD: pkgpath.mk,v 1.57 2014/08/10 08:59:48 espie Exp $
# $OpenBSD: pkgpath.mk,v 1.58 2014/09/09 09:34:04 espie Exp $
# ex:ts=4 sw=4 filetype=make:
# pkgpath.mk - 2003 Marc Espie
# This file is in the public domain.
@ -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)