]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix to apply chroot to dnstap-socket-path, if chroot is enabled.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Aug 2020 12:55:16 +0000 (14:55 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Aug 2020 12:55:16 +0000 (14:55 +0200)
dnstap/dnstap.c
dnstap/dtstream.c
doc/Changelog

index cc5449dff4a1b103f394fc6e20c7b140cbbb2caa..bda837876dd360864a3c12d077a567e7d0203ac1 100644 (file)
@@ -134,9 +134,15 @@ dt_create(struct config_file* cfg)
 
        if(cfg->dnstap && cfg->dnstap_socket_path && cfg->dnstap_socket_path[0] &&
                (cfg->dnstap_ip==NULL || cfg->dnstap_ip[0]==0)) {
+               char* p = fname_after_chroot(cfg->dnstap_socket_path, cfg, 1);
+               if(!p) {
+                       log_err("malloc failure");
+                       return NULL;
+               }
                verbose(VERB_OPS, "attempting to connect to dnstap socket %s",
-                       cfg->dnstap_socket_path);
-               check_socket_file(cfg->dnstap_socket_path);
+                       p);
+               check_socket_file(p);
+               free(p);
        }
 
        env = (struct dt_env *) calloc(1, sizeof(struct dt_env));
index 7c8a08604a38b5eef36ab8a3d52ef83a2c02ad50..63d517cb896707ea2f9617bdaba6968c6b7acf62 100644 (file)
@@ -279,7 +279,8 @@ int dt_io_thread_apply_cfg(struct dt_io_thread* dtio, struct config_file *cfg)
                        return 0;
                }
                free(dtio->socket_path);
-               dtio->socket_path = strdup(cfg->dnstap_socket_path);
+               dtio->socket_path = fname_after_chroot(cfg->dnstap_socket_path,
+                       cfg, 1);
                if(!dtio->socket_path) {
                        log_err("dnstap setup: malloc failure");
                        return 0;
index 1923c17ad22bda378249caa9723063ecbc08cad8..37931d3956278cadc01ce94eba7d269cdd8667a1 100644 (file)
@@ -2,6 +2,7 @@
        - Fix that dnstap reconnects do not spam the log with the repeated
          attempts.  Attempts on the timer are only logged on high verbosity,
          if they produce a connection failure error.
+       - Fix to apply chroot to dnstap-socket-path, if chroot is enabled.
 
 20 August 2020: Ralph
        - Fix stats double count issue (#289).