Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
360e08a313 | ||
|
55b24201ff | ||
|
ae238f1389 | ||
|
5a156d0135 | ||
|
1fa1cdc30e | ||
|
e49b76b97e | ||
|
71b04deeff | ||
|
cced87a316 | ||
|
fb09a2bd29 | ||
|
b47f10fd42 | ||
|
46b038c6ed | ||
|
f11f166fd2 | ||
|
74a0fd925c | ||
|
7ce1df136e | ||
|
92310249fc | ||
|
5e9a1b476c | ||
|
8d2398d7b1 |
28
netresolve-0.0.1-hosts.patch
Normal file
28
netresolve-0.0.1-hosts.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
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
|
||||||
|
|
29
netresolve-0.0.1-strncpy.patch
Normal file
29
netresolve-0.0.1-strncpy.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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
|
||||||
|
|
41
netresolve-0.0.1-use-after-free.patch
Normal file
41
netresolve-0.0.1-use-after-free.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
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
|
||||||
|
|
@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
Name: netresolve
|
Name: netresolve
|
||||||
Version: 0.0.1
|
Version: 0.0.1
|
||||||
Release: 0.20%{?snapshot_suffix}%{?dist}
|
Release: 0.34%{?snapshot_suffix}%{?dist}
|
||||||
Summary: Generic name resolution library
|
Summary: Generic name resolution library
|
||||||
Group: System Environment/Libraries
|
|
||||||
License: BSD
|
License: BSD
|
||||||
# https://github.com/crossdistro/netresolve , possibly?
|
# https://github.com/crossdistro/netresolve , possibly?
|
||||||
URL: https://sourceware.org/%{name}/
|
URL: https://sourceware.org/%{name}/
|
||||||
@ -12,7 +11,12 @@ Source0: %{name}-0.0.1.tar.xz
|
|||||||
# Fix a syntax error in a test
|
# Fix a syntax error in a test
|
||||||
# From https://github.com/crossdistro/netresolve/pull/2
|
# From https://github.com/crossdistro/netresolve/pull/2
|
||||||
Patch0: netresolve-0.0.1-test-equality.patch
|
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: ldns-devel
|
||||||
BuildRequires: pkgconfig(libcares)
|
BuildRequires: pkgconfig(libcares)
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
@ -42,14 +46,12 @@ glibc as well as a testbed for future glibc improvements.
|
|||||||
|
|
||||||
%package core
|
%package core
|
||||||
Summary: Core netresolve libraries
|
Summary: Core netresolve libraries
|
||||||
Group: Development/Libraries
|
|
||||||
%description core
|
%description core
|
||||||
This package provides core netresolve library with basic name resolution
|
This package provides core netresolve library with basic name resolution
|
||||||
capabilities for tools and application.
|
capabilities for tools and application.
|
||||||
|
|
||||||
%package compat
|
%package compat
|
||||||
Summary: Compatibility netresolve libraries and tools
|
Summary: Compatibility netresolve libraries and tools
|
||||||
Group: Development/Libraries
|
|
||||||
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
||||||
%description compat
|
%description compat
|
||||||
This package provides libraries and tools for using netresolve from applications
|
This package provides libraries and tools for using netresolve from applications
|
||||||
@ -57,7 +59,6 @@ built against other name resolution libraries.
|
|||||||
|
|
||||||
%package tools
|
%package tools
|
||||||
Summary: Command line tools based on core netresolve libraries
|
Summary: Command line tools based on core netresolve libraries
|
||||||
Group: Development/Libraries
|
|
||||||
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
||||||
%description tools
|
%description tools
|
||||||
This package provides tools that provide netresolve capabilities using the
|
This package provides tools that provide netresolve capabilities using the
|
||||||
@ -66,14 +67,12 @@ command line.
|
|||||||
%package backends-compat
|
%package backends-compat
|
||||||
Summary: Backends for netresolve using existing tools
|
Summary: Backends for netresolve using existing tools
|
||||||
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
||||||
Group: Development/Libraries
|
|
||||||
%description backends-compat
|
%description backends-compat
|
||||||
This package provides backends for querying libc, glibc nsswitch backends,
|
This package provides backends for querying libc, glibc nsswitch backends,
|
||||||
asyncns and other existing name resolution libraries.
|
asyncns and other existing name resolution libraries.
|
||||||
|
|
||||||
%package backends-aresdns
|
%package backends-aresdns
|
||||||
Summary: DNS backend for netresolve based on aresdns
|
Summary: DNS backend for netresolve based on aresdns
|
||||||
Group: Development/Libraries
|
|
||||||
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
||||||
%description backends-aresdns
|
%description backends-aresdns
|
||||||
This package provides DNS capabilities including learning DNSSEC validity
|
This package provides DNS capabilities including learning DNSSEC validity
|
||||||
@ -81,7 +80,6 @@ from the AD flag for netresolve using c-ares.
|
|||||||
|
|
||||||
%package backends-avahi
|
%package backends-avahi
|
||||||
Summary: Multicast DNS backend for netresolve based on libavahi
|
Summary: Multicast DNS backend for netresolve based on libavahi
|
||||||
Group: Development/Libraries
|
|
||||||
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
||||||
%description backends-avahi
|
%description backends-avahi
|
||||||
This package provides Multicast DNS capabilities using Avahi daemon and
|
This package provides Multicast DNS capabilities using Avahi daemon and
|
||||||
@ -90,7 +88,6 @@ libraries.
|
|||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
%package backends-ubdns
|
%package backends-ubdns
|
||||||
Summary: DNS backend for netresolve based on libunbound
|
Summary: DNS backend for netresolve based on libunbound
|
||||||
Group: Development/Libraries
|
|
||||||
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
Requires: %{name}-core%{?_isa} = %{version}-%{release}
|
||||||
%description backends-ubdns
|
%description backends-ubdns
|
||||||
This package provides DNS capabilities including DNSSEC validation to
|
This package provides DNS capabilities including DNSSEC validation to
|
||||||
@ -99,7 +96,6 @@ netresolve using libunbound.
|
|||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for netresolve
|
Summary: Development files for netresolve
|
||||||
Group: Development/Libraries
|
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
%description devel
|
%description devel
|
||||||
This package contains header files and libraries needed to compile
|
This package contains header files and libraries needed to compile
|
||||||
@ -130,28 +126,21 @@ export NETRESOLVE_TEST_COMMAND="libtool execute valgrind --leak-check=full --err
|
|||||||
make check || { cat ./test-suite.log; false; }
|
make check || { cat ./test-suite.log; false; }
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
%ldconfig_scriptlets
|
||||||
%postun -p /sbin/ldconfig
|
|
||||||
|
|
||||||
%post core -p /sbin/ldconfig
|
%ldconfig_scriptlets core
|
||||||
%postun core -p /sbin/ldconfig
|
|
||||||
|
|
||||||
%post compat -p /sbin/ldconfig
|
%ldconfig_scriptlets compat
|
||||||
%postun compat -p /sbin/ldconfig
|
|
||||||
|
|
||||||
%post backends-compat -p /sbin/ldconfig
|
%ldconfig_scriptlets backends-compat
|
||||||
%postun backends-compat -p /sbin/ldconfig
|
|
||||||
|
|
||||||
%post backends-aresdns -p /sbin/ldconfig
|
%ldconfig_scriptlets backends-aresdns
|
||||||
%postun backends-aresdns -p /sbin/ldconfig
|
|
||||||
|
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
%post backends-ubdns -p /sbin/ldconfig
|
%ldconfig_scriptlets backends-ubdns
|
||||||
%postun backends-ubdns -p /sbin/ldconfig
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%post backends-avahi -p /sbin/ldconfig
|
%ldconfig_scriptlets backends-avahi
|
||||||
%postun backends-avahi -p /sbin/ldconfig
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
|
||||||
@ -249,6 +238,48 @@ make check || { cat ./test-suite.log; false; }
|
|||||||
%{_libdir}/libnss_netresolve.so
|
%{_libdir}/libnss_netresolve.so
|
||||||
|
|
||||||
%changelog
|
%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
|
* 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
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user