summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-03-22 10:24:11 +0100
committerColin Walters (automation) <walters+githubbot@verbum.org>2016-03-22 12:48:49 +0000
commit701f211b9df0e3940498c2260b83158f1159f2df (patch)
treed50ea1c2582282705193c8b443e1be3743063e4c /Makefile.am
parent506fb1b1624358d57095b20408414ccef6fbc22c (diff)
downloadbubblewrap-701f211b9df0e3940498c2260b83158f1159f2df.tar.gz
Add configure flags to allow setting setuid/setcaps
With this you can e.g. : ./configure --enable-sudo --with-priv-mode=setcaps make make install and it will ask you for sudo password and then make the final binary have the right capabilities set. This is not needed when setting such persmissions in e.g. a spec file, but it is useful for developers building bubblewrap. Pull request: #26 Approved by: cgwalters
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am15
1 files changed, 9 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
index 8fc2ae9..8e62ae4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,12 +5,15 @@ bin_PROGRAMS = bwrap
bwrap_srcpath := $(srcdir)
include Makefile-bwrap.am
-test-setuid: bwrap
- sudo chown root bwrap
- sudo sudo chmod u+s bwrap
-
-test-setcaps: bwrap
- sudo setcap "cap_sys_admin+ep cap_sys_chroot+ep" bwrap
+install-exec-hook:
+if PRIV_MODE_SETUID
+ $(SUDO_BIN) chown root $(DESTDIR)$(bindir)/bwrap
+ $(SUDO_BIN) chmod u+s $(DESTDIR)$(bindir)/bwrap
+else
+if PRIV_MODE_FILECAPS
+ $(SUDO_BIN) setcap cap_sys_admin,cap_sys_chroot+ep $(DESTDIR)$(bindir)/bwrap
+endif
+endif
include Makefile-docs.am