summaryrefslogtreecommitdiff
path: root/share/mk/bsd.own.mk
diff options
context:
space:
mode:
authorMartin Natano <natano@cvs.openbsd.org>2016-10-05 18:00:42 +0000
committerMartin Natano <natano@cvs.openbsd.org>2016-10-05 18:00:42 +0000
commit10476eb8c3cf1ff8ac538bcf223d032bb935fc02 (patch)
tree7fd9786b1496e6202e028c798ebb2d154ee11a64 /share/mk/bsd.own.mk
parent0d2b0b0bb362af89ca9203fe35aff60ce86fd86b (diff)
De-escalate to an unprivileged users during 'make build' and 'make release'.
- If you start make build as root, everything will be run as root. Nothing new here. New is, that you can set BUILDUSER=somebody and the unprived parts will be run as somebody. - If you start make build with sudo, the unprived parts will be run as the real user (meaning YOU). You can still set BUILDUSER=somebody and the uprived parts will run as somebody. - If you start make build as a normal user it will error out. "I'm sorry Dave." Note that DESTDIR must be on partition with the noperm flag set for make release to work correctly as an unprivileged user. idea and ok deraadt input and ok tb ratchov millert rpe, halex and probably others where part of the conversation to make this happen, thanks!
Diffstat (limited to 'share/mk/bsd.own.mk')
-rw-r--r--share/mk/bsd.own.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index 36fa4027a90..82d33d688f4 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -1,4 +1,4 @@
-# $OpenBSD: bsd.own.mk,v 1.179 2016/09/21 18:27:55 natano Exp $
+# $OpenBSD: bsd.own.mk,v 1.180 2016/10/05 18:00:41 natano Exp $
# $NetBSD: bsd.own.mk,v 1.24 1996/04/13 02:08:09 thorpej Exp $
# Host-specific overrides
@@ -128,6 +128,8 @@ DEFAULT_PIE_DEF=-DPIE_DEFAULT=1
NOPROFILE=
.endif
+BUILDUSER?= ${USER}
+
BSD_OWN_MK=Done
.PHONY: spell clean cleandir obj manpages print all \