mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
knot: update to 2.2.0
Signed-off-by: Daniel Salzman <daniel.salzman@nic.cz>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
diff --git a/src/contrib/files.c b/src/contrib/files.c
|
||||
index 8aee482..12f36ca 100644
|
||||
--- a/src/contrib/files.c
|
||||
+++ b/src/contrib/files.c
|
||||
@@ -24,6 +24,10 @@
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+#ifndef O_NOFOLLOW
|
||||
+#define O_NOFOLLOW 0
|
||||
+#endif
|
||||
+
|
||||
static bool special_name(const char *name)
|
||||
{
|
||||
return strcmp(name, ".") == 0 || strcmp(name, "..") == 0;
|
||||
@@ -1,15 +0,0 @@
|
||||
diff --git a/libtap/tap/files.c b/libtap/tap/files.c
|
||||
index 0c24075..d33db6c 100644
|
||||
--- a/libtap/tap/files.c
|
||||
+++ b/libtap/tap/files.c
|
||||
@@ -27,6 +27,10 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+#ifndef O_NOFOLLOW
|
||||
+#define O_NOFOLLOW 0
|
||||
+#endif
|
||||
+
|
||||
char *test_mkdtemp(void)
|
||||
{
|
||||
char *tmpdir = getenv("TMPDIR");
|
||||
@@ -0,0 +1,37 @@
|
||||
diff --git a/src/knot/conf/base.c b/src/knot/conf/base.c
|
||||
index 9a0a655..e4721ad 100644
|
||||
--- a/src/knot/conf/base.c
|
||||
+++ b/src/knot/conf/base.c
|
||||
@@ -101,6 +101,10 @@ void conf_refresh_hostname(
|
||||
|
||||
free(conf->hostname);
|
||||
conf->hostname = sockaddr_hostname();
|
||||
+ if (conf->hostname == NULL) {
|
||||
+ // Empty hostname fallback, NULL cannot be passed to strlen!
|
||||
+ conf->hostname = strdup("");
|
||||
+ }
|
||||
}
|
||||
|
||||
static void init_cache(
|
||||
@@ -206,7 +210,7 @@ int conf_new(
|
||||
|
||||
// Cache the current hostname.
|
||||
if (!(flags & CONF_FNOHOSTNAME)) {
|
||||
- out->hostname = sockaddr_hostname();
|
||||
+ conf_refresh_hostname(out);
|
||||
}
|
||||
|
||||
// Initialize cached values.
|
||||
diff --git a/src/knot/modules/dnstap.c b/src/knot/modules/dnstap.c
|
||||
index 890663d..b60c1ca 100644
|
||||
--- a/src/knot/modules/dnstap.c
|
||||
+++ b/src/knot/modules/dnstap.c
|
||||
@@ -241,7 +241,7 @@ int dnstap_load(struct query_plan *plan, struct query_module *self,
|
||||
} else {
|
||||
ctx->identity = sockaddr_hostname();
|
||||
}
|
||||
- ctx->identity_len = strlen(ctx->identity);
|
||||
+ ctx->identity_len = (ctx->identity != NULL) ? strlen(ctx->identity) : 0;
|
||||
|
||||
// Set version.
|
||||
val = conf_mod_get(self->config, MOD_VERSION, self->id);
|
||||
Reference in New Issue
Block a user