From fcc3635e6ba515fc45f6a5d2a592dbe436e241cd Mon Sep 17 00:00:00 2001 From: Nikola Pajkovsky Date: Mon, 16 Jan 2012 11:55:43 +0100 Subject: [PATCH] rhbz781833 - broken DNS lookup Signed-off-by: Nikola Pajkovsky --- 0001-fix-wrongly-used-execl.patch | 44 +++++++++++++++++++++++++++++++ iptraf-ng.spec | 9 ++++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 0001-fix-wrongly-used-execl.patch diff --git a/0001-fix-wrongly-used-execl.patch b/0001-fix-wrongly-used-execl.patch new file mode 100644 index 0000000..24711e7 --- /dev/null +++ b/0001-fix-wrongly-used-execl.patch @@ -0,0 +1,44 @@ +From b78e62ca2bf6dc887963071d02c7c21ba7355989 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Nikola Pajkovsky +Date: Mon, 16 Jan 2012 11:47:01 +0100 +Subject: [PATCH] fix wrongly used execl + +Signed-off-by: Nikola Pajkovsky +--- + src/itrafmon.c | 19 +++++++++++-------- + 1 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/src/itrafmon.c b/src/itrafmon.c +index 2669a54..040b0e0 100644 +--- a/src/itrafmon.c ++++ b/src/itrafmon.c +@@ -502,14 +502,17 @@ int checkrvnamed(void) + indicate("Starting reverse lookup server"); + + if ((cpid = fork()) == 0) { +- execl("rvnamed-ng", "", (char*)NULL); +- +- /* +- * execl() never returns, so if we reach this point, we have +- * a problem. +- */ +- +- die("unable execl() rvnamed-ng"); ++ char *args[] = { ++ "rvnamed-ng", ++ NULL ++ }; ++ execvp("rvnamed-ng", args); ++ /* ++ * execvp() never returns, so if we reach this point, we have ++ * a problem. ++ */ ++ ++ die("unable execvp() rvnamed-ng"); + } else if (cpid == -1) { + write_error("Can't spawn new process; lookups will block", + daemonized); +-- +1.7.8 + diff --git a/iptraf-ng.spec b/iptraf-ng.spec index 21ed156..578f25a 100644 --- a/iptraf-ng.spec +++ b/iptraf-ng.spec @@ -1,7 +1,7 @@ Summary: A console-based network monitoring utility Name: iptraf-ng Version: 1.1.0 -Release: 1%{?dist} +Release: 2%{?dist} Source0: https://fedorahosted.org/releases/i/p/iptraf-ng/%{name}-%{version}.tar.gz Source1: iptraf-ng-logrotate.conf URL: https://fedorahosted.org/iptraf-ng/ @@ -12,6 +12,9 @@ BuildRequires: ncurses-devel Obsoletes: iptraf < 3.1 Provides: iptraf = 3.1 +# remove after a new version +Patch0: 0001-fix-wrongly-used-execl.patch + %description IPTraf-ng is a console-based network monitoring utility. IPTraf gathers data like TCP connection packet and byte counts, interface statistics @@ -32,6 +35,7 @@ on a wide variety of supported network cards. %prep %setup -q +%patch0 -p1 %build %configure @@ -66,5 +70,8 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) %{_sysconfdir}/logrotate.d/iptraf-ng %changelog +* Mon Jan 16 2011 Nikola Pajkovsky - 1.1.0-2 +- fix wrongly used execl + * Wed Jan 11 2011 Nikola Pajkovsky - 1.1.0-1 - Initialization build