]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Lower log level of unlink() errors in networkstatus_set_current_consensus().
authorAlexander Færøy <ahf@torproject.org>
Wed, 24 Apr 2019 23:50:13 +0000 (01:50 +0200)
committerAlexander Færøy <ahf@torproject.org>
Wed, 24 Apr 2019 23:59:37 +0000 (01:59 +0200)
In this patch we lower the log level of the failures for the three calls
to unlink() in networkstatus_set_current_consensus(). These errors might
trigger on Windows because the memory mapped consensus file keeps the
file in open state even after we have close()'d it. Windows will then
error on the unlink() call with a "Permission denied" error.

The consequences of ignoring these errors is that we leave an unused
file around on the file-system, which is an easier way to fix this
problem right now than refactoring networkstatus_set_current_consensus().

See: https://bugs.torproject.org/29930

changes/bug29930 [new file with mode: 0644]
src/feature/nodelist/networkstatus.c

diff --git a/changes/bug29930 b/changes/bug29930
new file mode 100644 (file)
index 0000000..a99b114
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (UI):
+    - Lower log level of unlink() errors during bootstrap. Fixes bug 29930;
+      bugfix on 0.4.0.1-alpha.
+
index a988f700f3e98cb5e1ab8e816bcc40e33f738fb2..24e3b212f0e3ee4046a681916e3f2c43e72b5bae 100644 (file)
@@ -2033,9 +2033,9 @@ networkstatus_set_current_consensus(const char *consensus,
          * latest consensus. */
         if (was_waiting_for_certs && from_cache)
           if (unlink(unverified_fname) != 0) {
-            log_warn(LD_FS,
-                     "Failed to unlink %s: %s",
-                     unverified_fname, strerror(errno));
+            log_debug(LD_FS,
+                      "Failed to unlink %s: %s",
+                      unverified_fname, strerror(errno));
           }
       }
       goto done;
@@ -2048,9 +2048,9 @@ networkstatus_set_current_consensus(const char *consensus,
       }
       if (was_waiting_for_certs && (r < -1) && from_cache) {
         if (unlink(unverified_fname) != 0) {
-            log_warn(LD_FS,
-                     "Failed to unlink %s: %s",
-                     unverified_fname, strerror(errno));
+            log_debug(LD_FS,
+                      "Failed to unlink %s: %s",
+                      unverified_fname, strerror(errno));
         }
       }
       goto done;
@@ -2115,9 +2115,9 @@ networkstatus_set_current_consensus(const char *consensus,
     waiting->set_at = 0;
     waiting->dl_failed = 0;
     if (unlink(unverified_fname) != 0) {
-      log_warn(LD_FS,
-               "Failed to unlink %s: %s",
-               unverified_fname, strerror(errno));
+      log_debug(LD_FS,
+                "Failed to unlink %s: %s",
+                unverified_fname, strerror(errno));
     }
   }