This commit is contained in:
kircher 2020-05-13 20:39:39 +08:00
parent b8babc4d75
commit 82028e80ba
3 changed files with 94 additions and 5 deletions

View File

@ -0,0 +1,27 @@
From 1dffabbdf5bafbd0bcea3858d83d46e40bf03261 Mon Sep 17 00:00:00 2001
From: Chunmei Xu <xuchunmei@huawei.com>
Date: Tue, 3 Mar 2020 20:44:33 +0800
Subject: [PATCH] iputils fix ping dead loop
---
ping_common.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ping_common.c b/ping_common.c
index 9fbaf9d..466e3fa 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -375,6 +375,10 @@ int pinger(ping_func_set_st *fset, socket_st *sock)
struct timeval tv;
gettimeofday(&tv, NULL);
+ if (tv.tv_sec < cur_time.tv_sec) {
+ gettimeofday(&cur_time, NULL);
+ gettimeofday(&tv, NULL);
+ }
ntokens = (tv.tv_sec - cur_time.tv_sec) * 1000 +
(tv.tv_usec - cur_time.tv_usec) / 1000;
if (!interval) {
--
2.19.1

View File

@ -0,0 +1,45 @@
From 4d7fb5a623a8c90007797244186d9c6654ad5056 Mon Sep 17 00:00:00 2001
From: liaichun <liaichun@huawei.com>
Date: Thu, 23 Apr 2020 15:15:58 +0800
Subject: [PATCH] bugfix-fix-update-problem
---
ninfod/ninfod.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ninfod/ninfod.c b/ninfod/ninfod.c
index badbf80..48bcdd4 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_net_setuid = 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_net_setuid, 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_net_setuid, CAP_SET);
+ cap_set_flag(cap_p, CAP_EFFECTIVE, 1, &cap_net_setuid, CAP_SET);
if (cap_set_proc(cap_p) < 0) {
DEBUG(LOG_ERR, "cap_set_proc: %s\n", strerror(errno));
--
2.19.1

View File

@ -1,6 +1,6 @@
Name: iputils
Version: 20190709
Release: 2
Release: 4
Summary: Network monitoring tools including ping
License: BSD and GPLv2+
URL: https://github.com/iputils/iputils
@ -16,7 +16,10 @@ Patch100: iputils-ifenslave.patch
Patch6000: 0001-iputils-arpings.patch
Patch6001: 0002-iputils-arpings-count.patch
Patch9000: bugfix-arping-w-does-not-take-effect.patch
Patch9000: bugfix-fix-ping-dead-loop.patch
Patch9001: bugfix-arping-w-does-not-take-effect.patch
Patch9002: bugfix-fix-update-problem.patch
BuildRequires: gcc meson libidn2-devel openssl-devel libcap-devel libxslt
BuildRequires: docbook5-style-xsl systemd glibc-kernheaders gettext
@ -42,6 +45,8 @@ cp %{SOURCE4} %{SOURCE5} .
%patch6000 -p1
%patch6001 -p1
%patch9000 -p1
%patch9001 -p1
%patch9002 -p1
%build
export CFLAGS="-fpie"
@ -96,11 +101,23 @@ install -cp ifenslave.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/
%{_mandir}/man8/*.8.gz
%changelog
* Wed Mar 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 20190709-2
- Type:bigfix
* Thu Apr 23 2020 liaichun <liaichun@huawei.com> - 20190709-4
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:bugfix the arping
- DESC: fix update problem
* Sat Mar 7 2020 liuzhikang <liuzhikang3@huawei.com> - 20190709-3
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:fix arping parameter -w does not take effect
* Tue Mar 3 2020 liuzhikang <liuzhikang3@huawei.com> - 20190709-2
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:update patches
* Wed Oct 9 2019 openEuler Buildteam <buildteam@openeuler.org> - 20190709-1
- Type:bugfix