!10 fix build error with libcap-2.32
Merge pull request !10 from eaglegai/master
This commit is contained in:
commit
ca284a37a4
51
0003-ninfod-change-variable-name-to-avoid-colliding.patch
Normal file
51
0003-ninfod-change-variable-name-to-avoid-colliding.patch
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
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));
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
27
iputils.spec
27
iputils.spec
@ -1,6 +1,6 @@
|
|||||||
Name: iputils
|
Name: iputils
|
||||||
Version: 20190709
|
Version: 20190709
|
||||||
Release: 3
|
Release: 4
|
||||||
Summary: Network monitoring tools including ping
|
Summary: Network monitoring tools including ping
|
||||||
License: BSD and GPLv2+
|
License: BSD and GPLv2+
|
||||||
URL: https://github.com/iputils/iputils
|
URL: https://github.com/iputils/iputils
|
||||||
@ -12,11 +12,11 @@ Source3: ninfod.service
|
|||||||
Source4: bsd.txt
|
Source4: bsd.txt
|
||||||
Source5: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
|
Source5: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
|
||||||
|
|
||||||
Patch100: iputils-ifenslave.patch
|
Patch0001: iputils-ifenslave.patch
|
||||||
|
Patch0002: 0001-iputils-arpings.patch
|
||||||
Patch6000: 0001-iputils-arpings.patch
|
Patch0003: 0002-iputils-arpings-count.patch
|
||||||
Patch6001: 0002-iputils-arpings-count.patch
|
Patch0004: bugfix-arping-w-does-not-take-effect.patch
|
||||||
Patch9000: bugfix-arping-w-does-not-take-effect.patch
|
Patch0005: 0003-ninfod-change-variable-name-to-avoid-colliding.patch
|
||||||
|
|
||||||
BuildRequires: gcc meson libidn2-devel openssl-devel libcap-devel libxslt
|
BuildRequires: gcc meson libidn2-devel openssl-devel libcap-devel libxslt
|
||||||
BuildRequires: docbook5-style-xsl systemd glibc-kernheaders gettext
|
BuildRequires: docbook5-style-xsl systemd glibc-kernheaders gettext
|
||||||
@ -38,10 +38,11 @@ the target machine is alive and receiving network traffic.
|
|||||||
%setup -q -a 1 -n %{name}-s%{version}
|
%setup -q -a 1 -n %{name}-s%{version}
|
||||||
cp %{SOURCE4} %{SOURCE5} .
|
cp %{SOURCE4} %{SOURCE5} .
|
||||||
|
|
||||||
%patch100 -p1
|
%patch0001 -p1
|
||||||
%patch6000 -p1
|
%patch0002 -p1
|
||||||
%patch6001 -p1
|
%patch0003 -p1
|
||||||
%patch9000 -p1
|
%patch0004 -p1
|
||||||
|
%patch0005 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS="-fpie"
|
export CFLAGS="-fpie"
|
||||||
@ -96,6 +97,12 @@ install -cp ifenslave.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/
|
|||||||
%{_mandir}/man8/*.8.gz
|
%{_mandir}/man8/*.8.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jul 07 2020 gaihuiying <gaihuiying1@huawei.com> - 20190709-4
|
||||||
|
- Type:bugfix
|
||||||
|
- Id:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC:fix building error with libcap's new version
|
||||||
|
|
||||||
* Mon May 18 2020 openEuler Buildteam <buildteam@openeuler.org> - 20190709-3
|
* Mon May 18 2020 openEuler Buildteam <buildteam@openeuler.org> - 20190709-3
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- Id:NA
|
- Id:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user