From 701f211b9df0e3940498c2260b83158f1159f2df Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 22 Mar 2016 10:24:11 +0100 Subject: 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 --- Makefile.am | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Makefile.am') 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 -- cgit v1.2.1