summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2019-04-01 19:33:14 +0100
committerSami Kerola <kerolasa@iki.fi>2019-04-01 19:36:50 +0100
commitd45a8c8034c076948cea2f37dee5f7930a50f8f0 (patch)
treeb23daaed4d7bd2798be7b877677aee0ceed0a5ac
parentc3c04a9a1f590754cdd022a61fbde673e6660ce8 (diff)
downloadiputils-d45a8c8034c076948cea2f37dee5f7930a50f8f0.tar.gz
build-sys: allow disabling setcap-setuid.sh at install
Commit 46d08f2 introduced a setcap or setuid call when installing iputils. This clashes with our (Gentoo) sandbox because build system is trying to modify files outside of DESTDIR. Addresses: https://github.com/iputils/iputils/issues/175 Reported-by: Thomas Deutschmann <whissi@whissi.de> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rwxr-xr-xbuild-aux/setcap-setuid.sh4
-rw-r--r--meson.build4
-rw-r--r--meson_options.txt3
3 files changed, 10 insertions, 1 deletions
diff --git a/build-aux/setcap-setuid.sh b/build-aux/setcap-setuid.sh
index dba6c03..f317a22 100755
--- a/build-aux/setcap-setuid.sh
+++ b/build-aux/setcap-setuid.sh
@@ -7,6 +7,10 @@ perm_type="$3"
setcap="$4"
case "$perm_type" in
+ 'none')
+ # Gentoo needs build system to back off.
+ # https://github.com/iputils/iputils/issues/175
+ ;;
'caps')
echo "$0: calling: $setcap cap_net_raw+ep $exec_path"
"$setcap" 'cap_net_raw+ep' "$exec_path" || true
diff --git a/meson.build b/meson.build
index 8bb5756..efb4dc2 100644
--- a/meson.build
+++ b/meson.build
@@ -219,7 +219,9 @@ config_h = configure_file(
configuration : conf)
setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
-if cap_dep.found() and setcap.found()
+if get_option('NO_SETCAP_OR_SUID')
+ perm_type = 'none'
+elif cap_dep.found() and setcap.found()
perm_type = 'caps'
else
perm_type = 'setuid'
diff --git a/meson_options.txt b/meson_options.txt
index d99e9d6..4b32418 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -47,6 +47,9 @@ option('BUILD_MANS', type : 'boolean', value : true,
option('BUILD_HTML_MANS', type : 'boolean', value : false,
description : 'Build html manuals')
+option('NO_SETCAP_OR_SUID', type : 'boolean', value : false,
+ description : 'Allow disabling build-aux/setcap-setuid.sh')
+
option('ARPING_DEFAULT_DEVICE', type : 'string', value : '',
description : 'Default device for arping')