]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
(cherry-picked by nickm, with changes file from isis.)
authors0rlxmh0 <s6yg1ez3@mail2tor.com>
Mon, 2 May 2016 18:01:36 +0000 (14:01 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 2 May 2016 18:01:36 +0000 (14:01 -0400)
changes/bug18920 [new file with mode: 0644]
src/or/control.c

diff --git a/changes/bug18920 b/changes/bug18920
new file mode 100644 (file)
index 0000000..1babfd6
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (controller, microdescriptors):
+    - Make GETINFO dir/status-vote/current/consensus conform to the control
+      specification by returning "551 Could not open cached consensus..."
+      when not caching consensuses.
+      Fixes bug 18920; bugfix on 0.2.2.6-alpha.
index 655b4dd335d48d43b318ddf883931dd40247977e..e06d7d28a21200badeb0fddf1ff079c8d88ad490 100644 (file)
@@ -2011,6 +2011,11 @@ getinfo_helper_dir(control_connection_t *control_conn,
       char *filename = get_datadir_fname("cached-consensus");
       *answer = read_file_to_str(filename, RFTS_IGNORE_MISSING, NULL);
       tor_free(filename);
+      if (!*answer) { /* generate an error */
+        *errmsg = "Could not open cached consensus. "
+          "Make sure FetchUselessDescriptors is set to 1.";
+        return -1;
+      }
     }
   } else if (!strcmp(question, "network-status")) { /* v1 */
     routerlist_t *routerlist = router_get_routerlist();