1
0
forked from ports/opt

iputils: fix build with libcap 2.29

This commit is contained in:
Juergen Daubert 2019-12-28 18:53:31 +01:00
parent ebf9754b48
commit 47ad259728
3 changed files with 55 additions and 4 deletions

View File

@ -1,6 +1,7 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/f04elkTm+0RbTGVUTyC+P/3kegbS8/947cuNLKHleSaG/haTEazZ7qTeQD6d6Nvgpxmk+8I/rMgtmnBlI5sDQQ=
SHA256 (Pkgfile) = a761bca1cd40993ae0a47dc42865978a5dd22cad45eef5f8981012de6b78a4f1
RWSE3ohX2g5d/dpdl7QmCK/T3Cs5gSyi+GtjTtmDgsgjhvoDso6VaQMh3b+EGygrKCsJy21x8LcuPzED7QWtG77DiPj1IHQyVww=
SHA256 (Pkgfile) = ae5c82625dfb5bc331ac2338baa40157a3bf5966572307c47da8cf61c460441f
SHA256 (.footprint) = 43939b63c3bfc9cf8414b95ebaf536426c9dad9e972a6a8baf6f74c00947c372
SHA256 (iputils-s20190709.tar.gz) = a15720dd741d7538dd2645f9f516d193636ae4300ff7dbc8bfca757bf166490a
SHA256 (libcap-2.29.patch) = e75541a231472647723a16c9c176de623617c1d100d10802dd0e47e8fce60491
SHA256 (iputils-man-s20190709.tar.xz) = eef3556f4093feefb78b969875d09fc28d7c182629c408e0a4c9b3a137c0b374

View File

@ -5,13 +5,15 @@
name=iputils
version=s20190709
release=1
release=2
source=(https://github.com/iputils/iputils/archive/$version/$name-$version.tar.gz
$name-man-$version.tar.xz)
libcap-2.29.patch $name-man-$version.tar.xz)
build() {
cd $name-$version
patch -p1 -i $SRC/libcap-2.29.patch
meson build --prefix /usr \
-D BUILD_MANS=false \
-D BUILD_TRACEROUTE6=true \

48
iputils/libcap-2.29.patch Normal file
View File

@ -0,0 +1,48 @@
From 18f9a84e0e702841d6cc4d5f593de4fbd1348e83 Mon Sep 17 00:00:00 2001
From: Sami Kerola <kerolasa@iki.fi>
Date: Sat, 28 Dec 2019 17:16:27 +0000
Subject: [PATCH] ninfod: change variable name to avoid colliding with function
name
The sys/capability.h header has 'extern int cap_setuid(uid_t uid);'
function prototype.
Addresses: https://github.com/iputils/iputils/issues/246
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
ninfod/ninfod.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ninfod/ninfod.c b/ninfod/ninfod.c
index 26112d0..95583de 100644
--- a/ninfod/ninfod.c
+++ b/ninfod/ninfod.c
@@ -455,7 +455,7 @@ static void do_daemonize(void)
/* --------- */
#ifdef HAVE_LIBCAP
static const cap_value_t cap_net_raw = CAP_NET_RAW;
-static const cap_value_t cap_setuid = CAP_SETUID;
+static const cap_value_t cap_setuserid = CAP_SETUID;
static cap_flag_value_t cap_ok;
#else
static uid_t euid;
@@ -487,7 +487,7 @@ static void limit_capabilities(void)
cap_get_flag(cap_cur_p, CAP_SETUID, CAP_PERMITTED, &cap_ok);
if (cap_ok != CAP_CLEAR)
- cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuid, CAP_SET);
+ cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuserid, CAP_SET);
if (cap_set_proc(cap_p) < 0) {
DEBUG(LOG_ERR, "cap_set_proc: %s\n", strerror(errno));
@@ -520,8 +520,8 @@ static void drop_capabilities(void)
/* setuid / setuid */
if (cap_ok != CAP_CLEAR) {
- cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuid, CAP_SET);
- cap_set_flag(cap_p, CAP_EFFECTIVE, 1, &cap_setuid, CAP_SET);
+ cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuserid, CAP_SET);
+ cap_set_flag(cap_p, CAP_EFFECTIVE, 1, &cap_setuserid, CAP_SET);
if (cap_set_proc(cap_p) < 0) {
DEBUG(LOG_ERR, "cap_set_proc: %s\n", strerror(errno));