logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git
commit: fa73eed05e35d6fb4f07cb98e2f95efbeafb807d
parent e4e6b8fbbfb4451c85622664fcbebed9e4ae7243
Author: Michael Forney <mforney@mforney.org>
Date:   Fri, 20 Mar 2020 16:10:00 -0700

nsd: Update to 4.3.0

Diffstat:

Mpkg/nsd/.gitignore2+-
Mpkg/nsd/config.h22++++++++++++++++++++--
Mpkg/nsd/gen.lua4+++-
Mpkg/nsd/patch/0001-Remove-quotes-from-dbfile-in-man-pages.patch10+++++-----
Mpkg/nsd/patch/0002-Use-timingsafe_memcmp-if-available.patch10+++++-----
Dpkg/nsd/patch/0003-Avoid-pointer-arithmetic-on-void.patch180-------------------------------------------------------------------------------
Dpkg/nsd/patch/0004-Avoid-unnecessary-VLA.patch28----------------------------
Mpkg/nsd/sha2562+-
Mpkg/nsd/url2+-
Mpkg/nsd/ver2+-
10 files changed, 37 insertions(+), 225 deletions(-)

diff --git a/pkg/nsd/.gitignore b/pkg/nsd/.gitignore @@ -1,2 +1,2 @@ -/nsd-4.2.4.tar.gz +/nsd-4.3.0.tar.gz /src diff --git a/pkg/nsd/config.h b/pkg/nsd/config.h @@ -22,6 +22,9 @@ #define HAVE_CHOWN 1 #define HAVE_CHROOT 1 #define HAVE_CLOCK_GETTIME 1 +/* #undef HAVE_CPUID_T */ +/* #undef HAVE_CPUSET_T */ +#define HAVE_CPU_SET_T 1 /* #undef HAVE_CRYPTO_MEMCMP */ #define HAVE_CTIME_R_PROTO 1 /* #undef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO */ @@ -48,6 +51,7 @@ #define HAVE_GETHOSTNAME 1 #define HAVE_GETNAMEINFO 1 #define HAVE_GETPWNAM 1 +#define HAVE_GETRANDOM 1 #define HAVE_GLOB 1 #define HAVE_GLOB_H 1 #define HAVE_GRP_H 1 @@ -85,7 +89,9 @@ #define HAVE_PWRITE 1 #define HAVE_REALLOCARRAY 1 /* #undef HAVE_RECVMMSG */ +#define HAVE_SCHED_H 1 /* #undef HAVE_SENDMMSG */ +/* #undef HAVE_SETPROCTITLE */ #define HAVE_SETREGID 1 #define HAVE_SETRESGID 1 #define HAVE_SETRESUID 1 @@ -120,8 +126,10 @@ #define HAVE_STRUCT_TIMESPEC 1 /* #undef HAVE_SYSLOG_H */ /* #undef HAVE_SYS_BITYPES_H */ +/* #undef HAVE_SYS_CPUSET_H */ /* #undef HAVE_SYS_MMAN_H */ #define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_RANDOM_H 1 #define HAVE_SYS_SELECT_H 1 #define HAVE_SYS_SOCKET_H 1 #define HAVE_SYS_STAT_H 1 @@ -155,10 +163,10 @@ /* #undef NSEC3 */ #define PACKAGE_BUGREPORT "nsd-bugs@nlnetlabs.nl" #define PACKAGE_NAME "NSD" -#define PACKAGE_STRING "NSD 4.2.4" +#define PACKAGE_STRING "NSD 4.3.0" #define PACKAGE_TARNAME "nsd" #define PACKAGE_URL "" -#define PACKAGE_VERSION "4.2.4" +#define PACKAGE_VERSION "4.3.0" /* #undef PACKED_STRUCTS */ #define PIDFILE "/run/nsd.pid" /* #undef RATELIMIT */ @@ -369,6 +377,16 @@ char *strptime(const char *s, const char *format, struct tm *tm); char *nsd_strptime(const char *s, const char *format, struct tm *tm); #define strptime(a,b,c) nsd_strptime((a),(b),(c)) #endif +#if (HAVE_CPU_SET_T || HAVE_CPUSET_T) +#include "compat/cpuset.h" +#endif +#ifndef HAVE_SETPROCTITLE +#ifdef __linux__ +#define HAVE_SETPROCTITLE 1 +#include <stdarg.h> +void setproctitle(char *fmt, ...); +#endif +#endif #ifdef MEMCMP_IS_BROKEN #include "compat/memcmp.h" #define memcmp memcmp_nsd diff --git a/pkg/nsd/gen.lua b/pkg/nsd/gen.lua @@ -1,6 +1,7 @@ cflags{ '-Wall', '-I $dir', + '-I $srcdir', '-I $basedir/pkg/openbsd/include', } @@ -8,7 +9,8 @@ lib('libcommon.a', [[ answer.c axfr.c buffer.c configlexer.c configparser.c dname.c dns.c edns.c iterated_hash.c lookup3.c namedb.c nsec3.c options.c packet.c query.c rbtree.c radtree.c rdata.c region-allocator.c rrl.c tsig.c - tsig-openssl.c udb.c udbradtree.c udbzone.c util.c + tsig-openssl.c udb.c udbradtree.c udbzone.c util.c bitset.c popen3.c + compat/(cpuset.c setproctitle.c) $builddir/pkg/openbsd/libbsd.a ]]) diff --git a/pkg/nsd/patch/0001-Remove-quotes-from-dbfile-in-man-pages.patch b/pkg/nsd/patch/0001-Remove-quotes-from-dbfile-in-man-pages.patch @@ -1,4 +1,4 @@ -From 9eea05a128090e9466cc76755e4ae9d0859c0e26 Mon Sep 17 00:00:00 2001 +From d5b4c0724306c268c8e28c7cebe7cb1e09e8299d Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sat, 14 Oct 2017 01:00:22 -0700 Subject: [PATCH] Remove quotes from @dbfile@ in man pages @@ -31,10 +31,10 @@ index 5e488958..babaa06a 100644 .B NSD database diff --git a/nsd.conf.5.in b/nsd.conf.5.in -index c7af7bec..c790e803 100644 +index b878cee2..15ad87be 100644 --- a/nsd.conf.5.in +++ b/nsd.conf.5.in -@@ -193,7 +193,7 @@ If yes, NSD listens to IPv6 connections. Default yes. +@@ -203,7 +203,7 @@ If yes, NSD listens to IPv6 connections. Default yes. .TP .B database:\fR <filename> By default @@ -43,7 +43,7 @@ index c7af7bec..c790e803 100644 is used. The specified file is used to store the compiled zone information. Same as commandline option .BR \-f. -@@ -916,7 +916,7 @@ also function as a resolver or cache. The configuration options that +@@ -949,7 +949,7 @@ also function as a resolver or cache. The configuration options that BIND9 has for the resolver or caching thus have no equivalents for NSD. .SH "FILES" .TP @@ -53,5 +53,5 @@ index c7af7bec..c790e803 100644 .B NSD database -- -2.24.0 +2.25.1 diff --git a/pkg/nsd/patch/0002-Use-timingsafe_memcmp-if-available.patch b/pkg/nsd/patch/0002-Use-timingsafe_memcmp-if-available.patch @@ -1,4 +1,4 @@ -From 8bb168cfe8640134c5c654fdda91632c6f131aa9 Mon Sep 17 00:00:00 2001 +From a42ca948ea74b976d2186798ed1023d9db44e983 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Tue, 21 Aug 2018 15:52:34 -0700 Subject: [PATCH] Use timingsafe_memcmp if available @@ -9,12 +9,12 @@ Subject: [PATCH] Use timingsafe_memcmp if available 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 806d8fba..b8e498f3 100644 +index 52e410c2..ce0f5b17 100644 --- a/configure.ac +++ b/configure.ac @@ -628,7 +628,7 @@ AC_CHECK_SIZEOF(void*) AC_CHECK_SIZEOF(off_t) - AC_CHECK_FUNCS([arc4random arc4random_uniform]) + AC_CHECK_FUNCS([getrandom arc4random arc4random_uniform]) AC_SEARCH_LIBS([setusercontext],[util],[AC_CHECK_HEADERS([login_cap.h])]) -AC_CHECK_FUNCS([tzset alarm chroot dup2 endpwent gethostname memset memcpy pwrite socket strcasecmp strchr strdup strerror strncasecmp strtol writev getaddrinfo getnameinfo freeaddrinfo gai_strerror sigaction sigprocmask strptime strftime localtime_r setusercontext glob initgroups setresuid setreuid setresgid setregid getpwnam mmap ppoll clock_gettime accept4]) +AC_CHECK_FUNCS([tzset alarm chroot dup2 endpwent gethostname memset memcpy pwrite socket strcasecmp strchr strdup strerror strncasecmp strtol writev getaddrinfo getnameinfo freeaddrinfo gai_strerror sigaction sigprocmask strptime strftime localtime_r setusercontext glob initgroups setresuid setreuid setresgid setregid getpwnam mmap ppoll clock_gettime accept4 timingsafe_memcmp]) @@ -22,7 +22,7 @@ index 806d8fba..b8e498f3 100644 AC_CHECK_TYPE([struct mmsghdr], AC_DEFINE(HAVE_MMSGHDR, 1, [If sys/socket.h has a struct mmsghdr.]), [], [ AC_INCLUDES_DEFAULT diff --git a/tsig.c b/tsig.c -index 91ca99b9..8c63ecfa 100644 +index 8b24fd1b..e75aa231 100644 --- a/tsig.c +++ b/tsig.c @@ -19,7 +19,9 @@ @@ -37,5 +37,5 @@ index 91ca99b9..8c63ecfa 100644 #define CRYPTO_memcmp memcmp_fixedtime int memcmp_fixedtime(const void *s1, const void *s2, size_t n) -- -2.24.0 +2.25.1 diff --git a/pkg/nsd/patch/0003-Avoid-pointer-arithmetic-on-void.patch b/pkg/nsd/patch/0003-Avoid-pointer-arithmetic-on-void.patch @@ -1,180 +0,0 @@ -From ecde6ced1a7d7649510c5428646e2a96477f6c6f Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Sun, 16 Jun 2019 23:17:47 -0700 -Subject: [PATCH] Avoid pointer arithmetic on `void *` -Upstream: https://github.com/NLnetLabs/nsd/pull/60 - -The pointer operand to the binary `+` operator must be to a complete -object type. ---- - dbaccess.c | 8 ++++---- - difffile.c | 4 ++-- - region-allocator.c | 4 ++-- - udb.c | 12 ++++++------ - udb.h | 4 ++-- - xfrd.c | 2 +- - 6 files changed, 17 insertions(+), 17 deletions(-) - -diff --git a/dbaccess.c b/dbaccess.c -index da0762e9..87f75f9c 100644 ---- a/dbaccess.c -+++ b/dbaccess.c -@@ -210,19 +210,19 @@ static void read_zone_recurse(udb_base* udb, namedb_type* db, - /* pre-order process of node->elem, for radix tree this is - * also in-order processing (identical to order tree_next()) */ - read_node_elem(udb, db, dname_region, zone, (struct domain_d*) -- (udb->base + node->elem.data)); -+ ((char*)udb->base + node->elem.data)); - } - if(node->lookup.data) { - uint16_t i; - struct udb_radarray_d* a = (struct udb_radarray_d*) -- (udb->base + node->lookup.data); -+ ((char*)udb->base + node->lookup.data); - /* we do not care for what the exact radix key is, we want - * to add all of them and the read routine does not need - * the radix-key, it has it stored */ - for(i=0; i<a->len; i++) { - if(a->array[i].node.data) { - read_zone_recurse(udb, db, dname_region, zone, -- (struct udb_radnode_d*)(udb->base + -+ (struct udb_radnode_d*)((char*)udb->base + - a->array[i].node.data)); - } - } -@@ -240,7 +240,7 @@ read_zone_data(udb_base* udb, namedb_type* db, region_type* dname_region, - if(RADTREE(&dtree)->root.data) - read_zone_recurse(udb, db, dname_region, zone, - (struct udb_radnode_d*) -- (udb->base + RADTREE(&dtree)->root.data)); -+ ((char*)udb->base + RADTREE(&dtree)->root.data)); - udb_ptr_unlink(&dtree, udb); - } - -diff --git a/difffile.c b/difffile.c -index b3aee0b4..82056ada 100644 ---- a/difffile.c -+++ b/difffile.c -@@ -1631,7 +1631,7 @@ void* task_new_stat_info(udb_base* udb, udb_ptr* last, struct nsdst* stat, - p = TASKLIST(&e)->zname; - memcpy(p, stat, sizeof(*stat)); - udb_ptr_unlink(&e, udb); -- return p + sizeof(*stat); -+ return (char*)p + sizeof(*stat); - } - #endif /* BIND8_STATS */ - -@@ -1653,7 +1653,7 @@ task_new_add_zone(udb_base* udb, udb_ptr* last, const char* zone, - TASKLIST(&e)->yesno = zonestatid; - p = TASKLIST(&e)->zname; - memcpy(p, zone, zlen+1); -- memmove(p+zlen+1, pattern, plen+1); -+ memmove((char*)p+zlen+1, pattern, plen+1); - udb_ptr_unlink(&e, udb); - } - -diff --git a/region-allocator.c b/region-allocator.c -index 638c861b..f53841ad 100644 ---- a/region-allocator.c -+++ b/region-allocator.c -@@ -272,7 +272,7 @@ region_alloc(region_type *region, size_t size) - region->total_allocated += size; - ++region->large_objects; - -- return result + sizeof(struct large_elem); -+ return (char *)result + sizeof(struct large_elem); - } - - if (region->recycle_bin && region->recycle_bin[aligned_size]) { -@@ -469,7 +469,7 @@ region_recycle(region_type *region, void *block, size_t size) - region->total_allocated -= size; - --region->large_objects; - -- l = (struct large_elem*)(block-sizeof(struct large_elem)); -+ l = (struct large_elem*)((char*)block-sizeof(struct large_elem)); - if(l->prev) - l->prev->next = l->next; - else region->large_list = l->next; -diff --git a/udb.c b/udb.c -index 1b41ab91..b02a482b 100644 ---- a/udb.c -+++ b/udb.c -@@ -192,13 +192,13 @@ udb_base_create_fd(const char* fname, int fd, udb_walk_relptr_func walkfunc, - } - - /* init completion */ -- udb->glob_data = (udb_glob_d*)(udb->base+sizeof(uint64_t)); -+ udb->glob_data = (udb_glob_d*)((char*)udb->base+sizeof(uint64_t)); - r = 0; - /* cannot be dirty because that is goto fail above */ - if(udb->glob_data->dirty_alloc != udb_dirty_clean) - r = 1; - udb->alloc = udb_alloc_create(udb, (udb_alloc_d*)( -- (void*)udb->glob_data+sizeof(*udb->glob_data))); -+ (char*)udb->glob_data+sizeof(*udb->glob_data))); - if(!udb->alloc) { - log_msg(LOG_ERR, "out of memory"); - udb_base_free(udb); -@@ -555,10 +555,10 @@ udb_base_remap(udb_base* udb, udb_alloc* alloc, uint64_t nsize) - /* fix up realpointers in udb and alloc */ - /* but mremap may have been nice and not move the base */ - udb->base = nb; -- udb->glob_data = (udb_glob_d*)(nb+sizeof(uint64_t)); -+ udb->glob_data = (udb_glob_d*)((char*)nb+sizeof(uint64_t)); - /* use passed alloc pointer because the udb->alloc may not - * be initialized yet */ -- alloc->disk = (udb_alloc_d*)((void*)udb->glob_data -+ alloc->disk = (udb_alloc_d*)((char*)udb->glob_data - +sizeof(*udb->glob_data)); - } - udb->base_size = nsize; -@@ -798,7 +798,7 @@ regen_ptrlist(void* base, udb_base* udb, udb_alloc* alloc, - if(exp == UDB_EXP_XL) { - assert(at != rb_old); /* should have been freed */ - regen_its_ptrs(base, udb, atp, -- ((void*)atp)+sizeof(udb_xl_chunk_d), -+ ((char*)atp)+sizeof(udb_xl_chunk_d), - sz-sizeof(udb_xl_chunk_d) - sizeof(uint64_t)*2, - rb_old, rb_new); - at += sz; -@@ -807,7 +807,7 @@ regen_ptrlist(void* base, udb_base* udb, udb_alloc* alloc, - } else { /* data chunk */ - assert(at != rb_old); /* should have been freed */ - regen_its_ptrs(base, udb, atp, -- ((void*)atp)+sizeof(udb_chunk_d), -+ ((char*)atp)+sizeof(udb_chunk_d), - sz-sizeof(udb_chunk_d)-1, rb_old, rb_new); - at += sz; - } -diff --git a/udb.h b/udb.h -index 8d7ee137..3ee98648 100644 ---- a/udb.h -+++ b/udb.h -@@ -52,9 +52,9 @@ typedef struct udb_alloc udb_alloc; - typedef uint64_t udb_void; - - /** convert relptr to usable pointer */ --#define UDB_REL(base, relptr) ((base) + (relptr)) -+#define UDB_REL(base, relptr) ((void*)((char*)(base) + (relptr))) - /** from system pointer to relative pointer */ --#define UDB_SYSTOREL(base, ptr) ((udb_void)((void*)(ptr) - (base))) -+#define UDB_SYSTOREL(base, ptr) ((udb_void)((char*)(ptr) - (char*)(base))) - - /** MAX 2**x exponent of alloced chunks, for 1Mbytes. The smallest - * chunk is 16bytes (8preamble+8data), so 0-3 is unused. */ -diff --git a/xfrd.c b/xfrd.c -index bd07d797..82551907 100644 ---- a/xfrd.c -+++ b/xfrd.c -@@ -2466,7 +2466,7 @@ static void - xfrd_process_stat_info_task(xfrd_state_type* xfrd, struct task_list_d* task) - { - size_t i; -- stc_type* p = (void*)task->zname + sizeof(struct nsdst); -+ stc_type* p = (void*)((char*)task->zname + sizeof(struct nsdst)); - stats_add(&xfrd->nsd->st, (struct nsdst*)task->zname); - for(i=0; i<xfrd->nsd->child_count; i++) { - xfrd->nsd->children[i].query_count += *p++; --- -2.24.0 - diff --git a/pkg/nsd/patch/0004-Avoid-unnecessary-VLA.patch b/pkg/nsd/patch/0004-Avoid-unnecessary-VLA.patch @@ -1,28 +0,0 @@ -From 3dbfc38645c53c2bf9b5f54635a2fa65ddaeab88 Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Sun, 16 Jun 2019 23:37:11 -0700 -Subject: [PATCH] Avoid unnecessary VLA -Upstream: https://github.com/NLnetLabs/nsd/pull/60 - ---- - xfrd-tcp.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/xfrd-tcp.c b/xfrd-tcp.c -index 1ae5311c..d00c13b7 100644 ---- a/xfrd-tcp.c -+++ b/xfrd-tcp.c -@@ -215,8 +215,8 @@ pipeline_find(struct xfrd_tcp_set* set, xfrd_zone_type* zone) - /* smaller buf than a full pipeline with 64kb ID array, only need - * the front part with the key info, this front part contains the - * members that the compare function uses. */ -- const size_t keysize = sizeof(struct xfrd_tcp_pipeline) - -- ID_PIPE_NUM*(sizeof(struct xfrd_zone*) + sizeof(uint16_t)); -+ enum { keysize = sizeof(struct xfrd_tcp_pipeline) - -+ ID_PIPE_NUM*(sizeof(struct xfrd_zone*) + sizeof(uint16_t)) }; - /* void* type for alignment of the struct, - * divide the keysize by ptr-size and then add one to round up */ - void* buf[ (keysize / sizeof(void*)) + 1 ]; --- -2.25.0 - diff --git a/pkg/nsd/sha256 b/pkg/nsd/sha256 @@ -1 +1 @@ -9ebd6d766765631a56c0eb332eac26b310fa39f662e5582c8210488cf91ef27c nsd-4.2.4.tar.gz +7a007d655d30f1edd001206839107e651966e1e519d53ba2c036491044111e97 nsd-4.3.0.tar.gz diff --git a/pkg/nsd/url b/pkg/nsd/url @@ -1 +1 @@ -url = "https://www.nlnetlabs.nl/downloads/nsd/nsd-4.2.4.tar.gz" +url = "https://www.nlnetlabs.nl/downloads/nsd/nsd-4.3.0.tar.gz" diff --git a/pkg/nsd/ver b/pkg/nsd/ver @@ -1 +1 @@ -4.2.4 r1 +4.3.0 r0