]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make 'getinfo fingerprint' return a 551 error if we're not a
authorRoger Dingledine <arma@torproject.org>
Thu, 15 Mar 2007 03:11:53 +0000 (03:11 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 15 Mar 2007 03:11:53 +0000 (03:11 +0000)
server, so we match what the control spec claims we do. Reported
by daejees.

svn:r9818

ChangeLog
src/or/control.c

index 554f1a8bb9d70b77ea702569fc8d63b18952a075..fe1fbf4f39940afff1e35a489ed974502f069db1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,9 @@ Changes in version 0.2.0.1-alpha - 2007-??-??
 
   o Minor bugfixes:
     - Stop allowing hibernating servers to be "stable" or "fast".
+    - Make 'getinfo fingerprint' return a 551 error if we're not a
+      server, so we match what the control spec claims we do. Reported
+      by daejees.
 
 
 Changes in version 0.1.2.10-rc - 2007-03-07
index 0c245723e1765f61c09e1d45767d86ef15423ad8..4784cb9092cdebb71eacd13521aa564cb486156e 100644 (file)
@@ -1207,13 +1207,11 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
     *answer = directory_dump_request_log();
   } else if (!strcmp(question, "fingerprint")) {
     routerinfo_t *me = router_get_my_routerinfo();
-    if (!me) {
-      *answer = tor_strdup("");
-    } else {
-      *answer = tor_malloc(HEX_DIGEST_LEN+1);
-      base16_encode(*answer, HEX_DIGEST_LEN+1, me->cache_info.identity_digest,
-                    DIGEST_LEN);
-    }
+    if (!me)
+      return -1;
+    *answer = tor_malloc(HEX_DIGEST_LEN+1);
+    base16_encode(*answer, HEX_DIGEST_LEN+1, me->cache_info.identity_digest,
+                  DIGEST_LEN);
   }
   return 0;
 }