mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 12:49:34 +02:00
iputils: resolve a name clash with latest libcap
(From OE-Core rev: cb1b5afb51806212b1b73a2432c596af0374b6a5) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
015c13ed83
commit
9383294cbc
@@ -0,0 +1,51 @@
|
|||||||
|
From ab1aa2eb0097a7ef05ffccac058b06812deb2695 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
|
||||||
|
|
||||||
|
Upstream-Status: Backport [https://github.com/iputils/iputils/commit/18f9a84e0e702841d6cc4d5f593de4fbd1348e83]
|
||||||
|
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
|
||||||
|
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
||||||
|
---
|
||||||
|
ninfod/ninfod.c | 8 ++++----
|
||||||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ninfod/ninfod.c b/ninfod/ninfod.c
|
||||||
|
index badbf80..28f03af 100644
|
||||||
|
--- a/ninfod/ninfod.c
|
||||||
|
+++ b/ninfod/ninfod.c
|
||||||
|
@@ -454,7 +454,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;
|
||||||
|
@@ -486,7 +486,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));
|
||||||
|
@@ -519,8 +519,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));
|
||||||
@@ -10,7 +10,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=55aa8c9fcad0691cef0ecd420361e390"
|
|||||||
|
|
||||||
DEPENDS = "gnutls"
|
DEPENDS = "gnutls"
|
||||||
|
|
||||||
SRC_URI = "git://github.com/iputils/iputils"
|
SRC_URI = "git://github.com/iputils/iputils \
|
||||||
|
file://0001-ninfod-change-variable-name-to-avoid-colliding-with-.patch \
|
||||||
|
"
|
||||||
SRCREV = "13e00847176aa23683d68fce1d17ffb523510946"
|
SRCREV = "13e00847176aa23683d68fce1d17ffb523510946"
|
||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
|
|||||||
Reference in New Issue
Block a user