[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Only reject POSTDESCRIPTOR purpose= when the purpose is unrecognized



commit 57ee0e3af98e5dce398e8bc7f6f2b77e53208288
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu May 23 08:24:29 2019 -0400

    Only reject POSTDESCRIPTOR purpose= when the purpose is unrecognized
    
    Fixes bug 30580; bugfix on 0.4.1.1-alpha.
---
 changes/ticket30580               | 4 ++++
 src/feature/control/control_cmd.c | 8 +++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/changes/ticket30580 b/changes/ticket30580
new file mode 100644
index 000000000..9ff1a33e4
--- /dev/null
+++ b/changes/ticket30580
@@ -0,0 +1,4 @@
+  o Minor bugfixes (controller):
+    - POSTDESCRIPTOR requests should work again. Previously, they were
+      broken if a "purpose=" flag was specified.  Fixes bug 30580;
+      bugfix on 0.4.1.1-alpha.
diff --git a/src/feature/control/control_cmd.c b/src/feature/control/control_cmd.c
index 5555a2c5c..17d5b0c7f 100644
--- a/src/feature/control/control_cmd.c
+++ b/src/feature/control/control_cmd.c
@@ -1049,9 +1049,11 @@ handle_control_postdescriptor(control_connection_t *conn,
   line = config_line_find_case(args->kwargs, "purpose");
   if (line) {
     purpose = router_purpose_from_string(line->value);
-    control_printf_endreply(conn, 552, "Unknown purpose \"%s\"",
-                            line->value);
-    goto done;
+    if (purpose == ROUTER_PURPOSE_UNKNOWN) {
+      control_printf_endreply(conn, 552, "Unknown purpose \"%s\"",
+                              line->value);
+      goto done;
+    }
   }
   line = config_line_find_case(args->kwargs, "cache");
   if (line) {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits