FreeBSD Bugzilla – Attachment 212149 Details for
Bug 244600
dns/knot-resolver: Fix critical cache space pre-allocation failure bug and add rc scripts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[patch] fix critical cache space pre-allocation failure bug and add rc scripts
knot-resolver.diff (text/plain), 8.49 KB, created by
yds
on 2020-03-04 21:47:15 UTC
(
hide
)
Description:
[patch] fix critical cache space pre-allocation failure bug and add rc scripts
Filename:
MIME Type:
Creator:
yds
Created:
2020-03-04 21:47:15 UTC
Size:
8.49 KB
patch
obsolete
>diff -ruN knot~resolver/Makefile knot-resolver/Makefile >--- knot~resolver/Makefile 2020-03-04 13:44:28.828678000 -0500 >+++ knot-resolver/Makefile 2020-03-04 14:41:43.200520000 -0500 >@@ -2,7 +2,8 @@ > # $FreeBSD$ > > PORTNAME= knot-resolver >-DISTVERSION= 5.0.1 >+PORTVERSION= 5.0.1 >+PORTREVISION= 1 > CATEGORIES= dns > MASTER_SITES= https://secure.nic.cz/files/knot-resolver/ \ > https://dns.company/downloads/knot-resolver/ >@@ -19,7 +20,7 @@ > luacheck:devel/lua-luacheck > > LIB_DEPENDS= libgnutls.so:security/gnutls \ >- libknot.so:dns/knot2-lib \ >+ libknot.so:dns/knot2 \ > liblmdb.so:databases/lmdb \ > libluajit-5.1.so:lang/luajit-openresty \ > libuv.so:devel/libuv >@@ -30,7 +31,11 @@ > USE_LDCONFIG= yes > LDFLAGS+= -L${LOCALBASE}/lib > >+USE_RC_SUBR= ${USERS} krescachegc > SUB_FILES= pkg-message >+SUB_LIST= RUNDIR=${RUNDIR} USER=${USERS} >+PLIST_SUB= RUNDIR=${RUNDIR} USER=${USERS} GROUP=${GROUPS} >+RUNDIR= /var/db/${USERS} > > SHEBANG_FILES= scripts/bench.sh \ > scripts/build-in-obs.sh \ >@@ -57,11 +62,11 @@ > --prefix=${LOCALBASE} \ > -Duser=${USERS} \ > -Dgroup=${GROUPS} \ >- -Dinstall_kresd_conf=enabled \ >+ -Dinstall_kresd_conf=disabled \ > -Dclient=enabled \ > -Dutils=enabled \ > -Dinstall_root_keys=enabled \ >- -Dkeyfile_default=${ETCDIR}/root.keys \ >+ -Dkeyfile_default=${RUNDIR}/root.keys \ > -Dmanaged_ta=enabled \ > -Droot_hints=${ETCDIR}/root.hints \ > -Dunit_tests=enabled >@@ -74,8 +79,8 @@ > # -Dconfig_tests=enabled \ # complains about missing cqueues lua package > # -Dextra_tests=enabled \ # also requires -Dsendmmsg=disabled > >-OPTIONS_DEFINE= DOCS DNSTAP DOXYGEN TRUSTANCHOR >-OPTIONS_DEFAULT= DOCS DNSTAP DOXYGEN >+OPTIONS_DEFINE= DOCS EXAMPLES DNSTAP DOXYGEN TRUSTANCHOR >+OPTIONS_DEFAULT= DOCS EXAMPLES DNSTAP DOXYGEN > > # docs/meson.build wants python2 or python3 - not -for example- python3.7 > # So this currently is partially broken: >@@ -105,6 +110,8 @@ > GROUPS= ${USERS} > > PORTDOCS= AUTHORS COPYING CodingStyle NEWS README.md >+PORTEXAMPLES= config.cluster config.docker config.internal \ >+ config.isp config.privacy config.splitview > > STRIP_TARGETS= sbin/kresd \ > sbin/kresc \ >@@ -119,8 +126,10 @@ > > pre-install-TEST-on: do-test > >+pre-install: >+ @${MKDIR} ${STAGEDIR}${RUNDIR} ${STAGEDIR}${DOCSDIR} >+ > post-install: >- @${MKDIR} ${STAGEDIR}${DOCSDIR} > ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}/ > .for STRIP_TGT in ${STRIP_TARGETS} > if [ -f ${STAGEDIR}${PREFIX}/${STRIP_TGT} ]; then \ >diff -ruN knot~resolver/files/krescachegc.in knot-resolver/files/krescachegc.in >--- knot~resolver/files/krescachegc.in 1969-12-31 19:00:00.000000000 -0500 >+++ knot-resolver/files/krescachegc.in 2020-03-04 14:51:49.077012000 -0500 >@@ -0,0 +1,37 @@ >+#!/bin/sh >+# >+# $FreeBSD$ >+# >+# PROVIDE: krescachegc >+# REQUIRE: SERVERS cleanvar >+# KEYWORD: shutdown >+# >+# Add the following lines to /etc/rc.conf to enable knot-resolver: >+# >+# krescachegc_enable="YES": Set to YES to enable krescachegc. >+# Set to NO by default. >+# krescachegc_rundir="": Set to %%RUNDIR%% by default. >+# krescachegc_millis="1000": Set to garbage collect interval in milliseconds >+# Set to 1000 by default. >+# >+ >+. /etc/rc.subr >+ >+name=krescachegc >+rcvar=krescachegc_enable >+ >+load_rc_config ${name} >+ >+# set defaults >+ >+krescachegc_enable=${krescachegc_enable:-"NO"} >+krescachegc_rundir=${krescachegc_rundir:-"%%RUNDIR%%"} >+krescachegc_millis=${krescachegc_millis:-"1000"} >+ >+pidfile=/var/run/kres-cache-gc.pid >+ >+command=/usr/sbin/daemon >+actual_command=%%PREFIX%%/sbin/kres-cache-gc >+command_args="-c -f -r -P ${pidfile} -u %%USER%% ${actual_command} -c ${krescachegc_rundir} -d ${krescachegc_millis}" >+ >+run_rc_command "$1" >diff -ruN knot~resolver/files/kresd.in knot-resolver/files/kresd.in >--- knot~resolver/files/kresd.in 1969-12-31 19:00:00.000000000 -0500 >+++ knot-resolver/files/kresd.in 2020-03-04 15:12:46.652631000 -0500 >@@ -0,0 +1,41 @@ >+#!/bin/sh >+# >+# $FreeBSD$ >+# >+# PROVIDE: kresd >+# REQUIRE: NETWORKING >+# BEFORE: SERVERS >+# KEYWORD: shutdown >+# >+# Add the following lines to /etc/rc.conf to enable knot-resolver: >+# >+# kresd_enable="YES": Set to YES to enable kresd. >+# Set to NO by default. >+# kresd_config="": Set to %%ETCDIR%%/kresd.conf >+# by default. >+# >+ >+. /etc/rc.subr >+ >+name=kresd >+rcvar=kresd_enable >+ >+load_rc_config ${name} >+ >+# set defaults >+ >+kresd_enable=${kresd_enable:-"NO"} >+kresd_rundir=${kresd_rundir:-"/var/db/${name}"} >+kresd_config=${kresd_config:-"%%ETCDIR%%/${name}.conf"} >+user=${name} >+group=${name} >+ >+pidfile=/var/run/${name}.pid >+ >+command=/usr/sbin/daemon >+actual_command=%%PREFIX%%/sbin/${name} >+command_args="-c -f -r -P ${pidfile} ${actual_command} -c ${kresd_config} -n ${kresd_rundir}" >+ >+required_files=${kresd_config} >+ >+run_rc_command "$1" >diff -ruN knot~resolver/files/patch-lib_cache_cdb_lmdb.c knot-resolver/files/patch-lib_cache_cdb_lmdb.c >--- knot~resolver/files/patch-lib_cache_cdb_lmdb.c 1969-12-31 19:00:00.000000000 -0500 >+++ knot-resolver/files/patch-lib_cache_cdb_lmdb.c 2020-02-05 10:35:04.000000000 -0500 >@@ -0,0 +1,16 @@ >+--- lib/cache/cdb_lmdb.c.orig 2020-02-05 10:35:04.000000000 -0500 >++++ lib/cache/cdb_lmdb.c 2020-02-05 10:35:04.000000000 -0500 >+@@ -345,7 +345,12 @@ >+ } >+ >+ ret = posix_fallocate(fd, 0, mapsize); >+- if (ret != 0) { >++ if (ret == EINVAL) { >++ /* POSIX says this can happen when the feature isn't supported by the FS. >++ * We haven't seen this happen on Linux+glibc but it was reported on FreeBSD.*/ >++ kr_log_info("[cache] space pre-allocation failed and ignored; " >++ "your (file)system probably doesn't support it.\n"); >++ } else if (ret != 0) { >+ mdb_txn_abort(txn); >+ stats->close++; >+ mdb_env_close(env->env); >diff -ruN knot~resolver/files/patch-meson.build knot-resolver/files/patch-meson.build >--- knot~resolver/files/patch-meson.build 1969-12-31 19:00:00.000000000 -0500 >+++ knot-resolver/files/patch-meson.build 2020-02-05 10:35:04.000000000 -0500 >@@ -0,0 +1,11 @@ >+--- meson.build.orig 2020-02-05 10:35:04.000000000 -0500 >++++ meson.build 2020-02-05 10:35:04.000000000 -0500 >+@@ -45,7 +45,7 @@ >+ prefix = get_option('prefix') >+ data_dir = join_paths(prefix, get_option('datadir'), 'knot-resolver') >+ doc_dir = join_paths(prefix, get_option('datadir'), 'doc', 'knot-resolver') >+-examples_dir = join_paths(doc_dir, 'examples') >++examples_dir = join_paths(prefix, get_option('datadir'), 'examples', 'knot-resolver') >+ etc_dir = join_paths(prefix, get_option('sysconfdir'), 'knot-resolver') >+ lib_dir = join_paths(prefix, get_option('libdir'), 'knot-resolver') >+ modules_dir = join_paths(lib_dir, 'kres_modules') >diff -ruN knot~resolver/pkg-descr knot-resolver/pkg-descr >--- knot~resolver/pkg-descr 2020-03-04 13:44:28.842159000 -0500 >+++ knot-resolver/pkg-descr 2020-03-04 13:43:50.061512000 -0500 >@@ -1,4 +1,15 @@ >-The Knot DNS Resolver is a caching full resolver implementation, >-including both a resolver library and a daemon. >+Knot Resolver is a caching full resolver implementation written in >+C and LuaJIT, both a resolver library and a daemon. The core >+architecture is tiny and efficient, and provides a foundation and >+a state-machine like API for extensions. There are three modules >+built-in â iterator, validator, cache, and a few more are loaded >+by default. Most of the rich features are written in Lua(JIT) and >+C. Batteries are included, but optional. > >-WWW: https://www.knot-resolver.cz/ >+Modular architecture of the library keeps the core tiny and efficient, >+and provides a state-machine like API for extensions. The Lua modules, >+switchable and shareable cache, and fast FFI bindings makes >+it great to tap into resolution process, or be used for your recursive >+DNS service. It's the OpenResty of DNS. >+ >+WWW: https://www.Knot-Resolver.cz/ >diff -ruN knot~resolver/pkg-plist knot-resolver/pkg-plist >--- knot~resolver/pkg-plist 2020-03-04 13:44:28.842368000 -0500 >+++ knot-resolver/pkg-plist 2020-03-04 13:21:47.436360000 -0500 >@@ -1,7 +1,6 @@ >+%%PORTEXAMPLES%%@sample %%EXAMPLESDIR%%/config.personal %%ETCDIR%%/%%USER%%.conf > %%ETCDIR%%/icann-ca.pem >-%%ETCDIR%%/kresd.conf > %%ETCDIR%%/root.hints >-%%ETCDIR%%/root.keys > include/libkres/api.h > include/libkres/array.h > include/libkres/cdb_api.h >@@ -93,10 +92,6 @@ > sbin/kres-cache-gc > sbin/kresc > sbin/kresd >-%%PORTDOCS%%%%DOCSDIR%%/examples/config.cluster >-%%PORTDOCS%%%%DOCSDIR%%/examples/config.docker >-%%PORTDOCS%%%%DOCSDIR%%/examples/config.internal >-%%PORTDOCS%%%%DOCSDIR%%/examples/config.isp >-%%PORTDOCS%%%%DOCSDIR%%/examples/config.personal >-%%PORTDOCS%%%%DOCSDIR%%/examples/config.privacy >-%%PORTDOCS%%%%DOCSDIR%%/examples/config.splitview >+@dir(%%USER%%,%%GROUP%%,0750) %%RUNDIR%% >+%%RUNDIR%%/root.keys >+@postexec chown -R %%USER%%:%%GROUP%% %%RUNDIR%%
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244600
: 212149 |
216109