Compare commits

..

No commits in common. "rawhide" and "f23" have entirely different histories.
rawhide ... f23

6 changed files with 27 additions and 224 deletions

View File

@ -1,28 +0,0 @@
From 1b41d34516968023c9eb97f0050f7393982c073b Mon Sep 17 00:00:00 2001
From: Petr Mensik <pemensik@redhat.com>
Date: Tue, 10 Sep 2019 16:54:24 +0200
Subject: [PATCH] Fix incorrect reading of hosts
When last line is missing newline, data are not correctly read. Parse
also remaining parse space.
---
backends/hosts.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/backends/hosts.c b/backends/hosts.c
index d3a076c..a93f74c 100644
--- a/backends/hosts.c
+++ b/backends/hosts.c
@@ -160,7 +160,8 @@ read_list(struct hosts_list *list)
new = buffer - 1;
}
}
-
+
+ read_item(list, buffer);
}
out:
close(fd);
--
2.20.1

View File

@ -1,29 +0,0 @@
From 08800e61eaba05265d3d976b0e9922f9bc4c63b2 Mon Sep 17 00:00:00 2001
From: Petr Mensik <pemensik@redhat.com>
Date: Mon, 18 Feb 2019 20:27:18 +0100
Subject: [PATCH] Always produce zero terminated address
---
lib/backend.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/backend.c b/lib/backend.c
index 1b3dadc..b895651 100644
--- a/lib/backend.c
+++ b/lib/backend.c
@@ -287,8 +287,10 @@ netresolve_backend_add_path(netresolve_query_t query,
if (length)
memcpy(path.node.address, address, length);
- else
- strncpy(path.node.address, address, sizeof path.node.address);
+ else {
+ path.node.address[sizeof(path.node.address)-1] = 0;
+ strncpy(path.node.address, address, sizeof(path.node.address)-1);
+ }
if (query->request.servname && (!socktype || !protocol || !port)) {
struct path_data data = { .query = query, .path = &path };
--
2.20.1

View File

@ -1,23 +0,0 @@
From 7257d3c06c27163e1d7f85bb9ab9e79520444492 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Wed, 1 Mar 2017 20:30:08 +0100
Subject: [PATCH 1/2] Fix test warning
---
tests/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/common.c b/tests/common.c
index 728997a..308b762 100644
--- a/tests/common.c
+++ b/tests/common.c
@@ -14,7 +14,7 @@ check_address(netresolve_query_t query, int exp_family, const char *exp_address_
assert(netresolve_query_get_count(query) == 1);
netresolve_query_get_node_info(query, 0, &family, &address, &ifindex);
- assert(family = exp_family);
+ assert(family == exp_family);
assert(!memcmp(address, exp_address, family == AF_INET6 ? 16 : 4));
assert(ifindex == exp_ifindex);
}

View File

@ -1,41 +0,0 @@
From 1f30af480852de8aa9ccba77a99d55b06832fc87 Mon Sep 17 00:00:00 2001
From: Petr Mensik <pemensik@redhat.com>
Date: Sat, 22 Jan 2022 17:51:48 +0100
Subject: [PATCH] Ensure variable is not used after free
Move free to end of function, where it would not need that variable
again.
---
backends/hosts.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/backends/hosts.c b/backends/hosts.c
index a93f74c..2378b6f 100644
--- a/backends/hosts.c
+++ b/backends/hosts.c
@@ -126,13 +126,13 @@ read_list(struct hosts_list *list)
char *new;
size_t size;
- free(hosts_file);
if (fd == -1) {
error("Cannot read hosts file '%s': %s", hosts_file, strerror(errno));
goto fail_open;
}
+
while (true) {
if (current == end)
goto out;
@@ -166,6 +166,7 @@ read_list(struct hosts_list *list)
out:
close(fd);
fail_open:
+ free(hosts_file);
add_node(list, NULL, 0, NULL, 0);
list->reserved = list->count;
list->items = realloc(list->items, list->reserved * sizeof *list->items);
--
2.31.1

View File

@ -1,37 +1,22 @@
%global snapshot_suffix .20160317git
%global snapshot_suffix .20160121git
Name: netresolve
Version: 0.0.1
Release: 0.34%{?snapshot_suffix}%{?dist}
Release: 0.12%{?snapshot_suffix}%{?dist}
Summary: Generic name resolution library
Group: System Environment/Libraries
License: BSD
# https://github.com/crossdistro/netresolve , possibly?
URL: https://sourceware.org/%{name}/
Source0: %{name}-0.0.1.tar.xz
# Fix a syntax error in a test
# From https://github.com/crossdistro/netresolve/pull/2
Patch0: netresolve-0.0.1-test-equality.patch
Patch1: netresolve-0.0.1-strncpy.patch
# https://github.com/crossdistro/netresolve/issues/3
Patch2: netresolve-0.0.1-hosts.patch
Patch3: netresolve-0.0.1-use-after-free.patch
BuildRequires: make
BuildRequires: ldns-devel
BuildRequires: pkgconfig(libcares)
%if 0%{?fedora}
BuildRequires: unbound-devel
%endif
BuildRequires: pkgconfig(avahi-client)
BuildRequires: pkgconfig(libasyncns)
# live builds
BuildRequires: autoconf automake libtool
# tests
BuildRequires: valgrind
%if 0%{?rhel}
# https://bugzilla.redhat.com/show_bug.cgi?id=1190724
BuildRequires: openssl-devel
%endif
# subpackages installed by netresolve virtual package
Requires: %{name}-core%{?_isa} = %{version}-%{release}
Requires: %{name}-tools%{?_isa} = %{version}-%{release}
@ -46,12 +31,14 @@ glibc as well as a testbed for future glibc improvements.
%package core
Summary: Core netresolve libraries
Group: Development/Libraries
%description core
This package provides core netresolve library with basic name resolution
capabilities for tools and application.
%package compat
Summary: Compatibility netresolve libraries and tools
Group: Development/Libraries
Requires: %{name}-core%{?_isa} = %{version}-%{release}
%description compat
This package provides libraries and tools for using netresolve from applications
@ -59,6 +46,7 @@ built against other name resolution libraries.
%package tools
Summary: Command line tools based on core netresolve libraries
Group: Development/Libraries
Requires: %{name}-core%{?_isa} = %{version}-%{release}
%description tools
This package provides tools that provide netresolve capabilities using the
@ -67,12 +55,14 @@ command line.
%package backends-compat
Summary: Backends for netresolve using existing tools
Requires: %{name}-core%{?_isa} = %{version}-%{release}
Group: Development/Libraries
%description backends-compat
This package provides backends for querying libc, glibc nsswitch backends,
asyncns and other existing name resolution libraries.
%package backends-aresdns
Summary: DNS backend for netresolve based on aresdns
Group: Development/Libraries
Requires: %{name}-core%{?_isa} = %{version}-%{release}
%description backends-aresdns
This package provides DNS capabilities including learning DNSSEC validity
@ -80,29 +70,30 @@ from the AD flag for netresolve using c-ares.
%package backends-avahi
Summary: Multicast DNS backend for netresolve based on libavahi
Group: Development/Libraries
Requires: %{name}-core%{?_isa} = %{version}-%{release}
%description backends-avahi
This package provides Multicast DNS capabilities using Avahi daemon and
libraries.
%if 0%{?fedora}
%package backends-ubdns
Summary: DNS backend for netresolve based on libunbound
Group: Development/Libraries
Requires: %{name}-core%{?_isa} = %{version}-%{release}
%description backends-ubdns
This package provides DNS capabilities including DNSSEC validation to
netresolve using libunbound.
%endif
%package devel
Summary: Development files for netresolve
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
This package contains header files and libraries needed to compile
applications or shared objects that use netresolve.
%prep
%autosetup -p1
%setup -q
NOCONFIGURE=yes ./autogen.sh
# disable some tests for now
@ -120,27 +111,30 @@ make %{?_smp_mflags}
%make_install
find %{buildroot} -name '*.la' -delete
%if 0%{?fedora}
%check
export NETRESOLVE_TEST_COMMAND="libtool execute valgrind --leak-check=full --error-exitcode=1 ./netresolve"
make check || { cat ./test-suite.log; false; }
%endif
%ldconfig_scriptlets
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets core
%post core -p /sbin/ldconfig
%postun core -p /sbin/ldconfig
%ldconfig_scriptlets compat
%post compat -p /sbin/ldconfig
%postun compat -p /sbin/ldconfig
%ldconfig_scriptlets backends-compat
%post backends-compat -p /sbin/ldconfig
%postun backends-compat -p /sbin/ldconfig
%ldconfig_scriptlets backends-aresdns
%post backends-aresdns -p /sbin/ldconfig
%postun backends-aresdns -p /sbin/ldconfig
%if 0%{?fedora}
%ldconfig_scriptlets backends-ubdns
%endif
%post backends-ubdns -p /sbin/ldconfig
%postun backends-ubdns -p /sbin/ldconfig
%ldconfig_scriptlets backends-avahi
%post backends-avahi -p /sbin/ldconfig
%postun backends-avahi -p /sbin/ldconfig
%files
@ -197,11 +191,9 @@ make check || { cat ./test-suite.log; false; }
%{_libdir}/libnetresolve-backend-avahi.so.0
%{_libdir}/libnetresolve-backend-avahi.so.0.0.0
%if 0%{?fedora}
%files backends-ubdns
%{_libdir}/libnetresolve-backend-ubdns.so.0
%{_libdir}/libnetresolve-backend-ubdns.so.0.0.0
%endif
%files devel
%{_includedir}/netresolve-epoll.h
@ -229,81 +221,13 @@ make check || { cat ./test-suite.log; false; }
%{_libdir}/libnetresolve-backend-loopback.so
%{_libdir}/libnetresolve-backend-nss.so
%{_libdir}/libnetresolve-backend-numerichost.so
%if 0%{?fedora}
%{_libdir}/libnetresolve-backend-ubdns.so
%endif
%{_libdir}/libnetresolve-backend-unix.so
%{_libdir}/libnetresolve-libc.so
%{_libdir}/libnetresolve.so
%{_libdir}/libnss_netresolve.so
%changelog
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.34.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Jan 22 2022 Petr Menšík <pemensik@redhat.com> - 0.0.1-0.33.20160317git
- Correct compilation issues
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.32.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.31.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.30.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Dec 19 2020 Adam Williamson <awilliam@redhat.com> - 0.0.1-0.29.20160317git
- Rebuild for libldns soname bump
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.28.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.27.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Sep 10 2019 Petr Menšík <pemensik@redhat.com> - 0.0.1-0.26.20160317git
- Pass tests even without trailing newline in hosts (#1736166)
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.25.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Feb 19 2019 Petr Menšík <pemensik@redhat.com> - 0.0.1-0.24.20160317git
- Fix build under new gcc (#1675450)
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.23.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Oct 08 2018 Petr Menšík <pemensik@redhat.com> - 0.0.1-0.22.20160317git
- Rebuilt for unbound 1.8
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.21.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.20.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.19.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.18.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Mar 09 2017 Adam Williamson <awilliam@redhat.com> - 0.0.1-0.17.20160317git
- Fix a syntax error in a test which broke compilation (pemensik)
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.16.20160317git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Mar 14 2016 Pavel Šimerda <psimerda@redhat.com> - 0.0.1-0.15.20160314git
- buildable on rhel, updated from git master
* Mon Mar 07 2016 Pavel Šimerda <psimerda@redhat.com> - 0.0.1-0.14.20160307git
- update from git master
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.13.20160121git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jan 21 2016 Pavel Šimerda <psimerda@redhat.com> - 0.0.1-0.12.20160121git
- updated live source

View File

@ -1 +1 @@
6280c91a682b52582b3394f331a802ba netresolve-0.0.1.tar.xz
40b5c358e527790e86c6baa01824899c netresolve-0.0.1.tar.xz