aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-06-28 15:47:07 -0400
committerNick Mathewson <nickm@torproject.org>2012-06-28 15:47:07 -0400
commite13e9c40c829d15fb71310b0638fff859b85580a (patch)
tree0697ba12dba31d2de37163864e202fd7edeca130 /src
parent1e008e98767fb1b98142a4099a837bbb2ce818f4 (diff)
downloadtor-e13e9c40c829d15fb71310b0638fff859b85580a.tar
tor-e13e9c40c829d15fb71310b0638fff859b85580a.tar.gz
Never emit the "opt" prefix in any directory stuff
Fix for bug 5124.
Diffstat (limited to 'src')
-rw-r--r--src/or/dirserv.c2
-rw-r--r--src/or/policies.c3
-rw-r--r--src/or/rephist.c2
-rw-r--r--src/or/router.c14
-rw-r--r--src/test/test_dir.c6
5 files changed, 13 insertions, 14 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index bfebbcdfb..d29c11d99 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2114,7 +2114,7 @@ routerstatus_format_entry(char *buf, size_t buf_len,
/* length of "opt v \n" */
#define V_LINE_OVERHEAD 7
if (version && strlen(version) < MAX_V_LINE_LEN - V_LINE_OVERHEAD) {
- if (tor_snprintf(cp, buf_len - (cp-buf), "opt v %s\n", version)<0) {
+ if (tor_snprintf(cp, buf_len - (cp-buf), "v %s\n", version)<0) {
log_warn(LD_BUG, "Unable to print router version.");
return -1;
}
diff --git a/src/or/policies.c b/src/or/policies.c
index b2b962dfd..201ed0410 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -1006,8 +1006,7 @@ policy_write_item(char *buf, size_t buflen, addr_policy_t *policy,
else
addrpart = addrbuf;
- result = tor_snprintf(buf, buflen, "%s%s%s %s",
- (is_ip6&&format_for_desc)?"opt ":"",
+ result = tor_snprintf(buf, buflen, "%s%s %s",
is_accept ? "accept" : "reject",
(is_ip6&&format_for_desc)?"6":"",
addrpart);
diff --git a/src/or/rephist.c b/src/or/rephist.c
index fa02f981f..1c5b51110 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1531,7 +1531,7 @@ rep_hist_get_bandwidth_lines(void)
const char *desc = NULL;
size_t len;
- /* opt [dirreq-](read|write)-history yyyy-mm-dd HH:MM:SS (n s) n,n,n... */
+ /* [dirreq-](read|write)-history yyyy-mm-dd HH:MM:SS (n s) n,n,n... */
/* The n,n,n part above. Largest representation of a uint64_t is 20 chars
* long, plus the comma. */
#define MAX_HIST_VALUE_LEN 21*NUM_TOTALS
diff --git a/src/or/router.c b/src/or/router.c
index 352c456f1..a766dfb68 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2053,9 +2053,9 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
"router %s %s %d 0 %d\n"
"%s"
"platform %s\n"
- "opt protocols Link 1 2 Circuit 1\n"
+ "protocols Link 1 2 Circuit 1\n"
"published %s\n"
- "opt fingerprint %s\n"
+ "fingerprint %s\n"
"uptime %ld\n"
"bandwidth %d %d %d\n"
"%s%s%s%s"
@@ -2074,15 +2074,15 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
(int) router->bandwidthrate,
(int) router->bandwidthburst,
(int) router->bandwidthcapacity,
- has_extra_info_digest ? "opt extra-info-digest " : "",
+ has_extra_info_digest ? "extra-info-digest " : "",
has_extra_info_digest ? extra_info_digest : "",
has_extra_info_digest ? "\n" : "",
- options->DownloadExtraInfo ? "opt caches-extra-info\n" : "",
+ options->DownloadExtraInfo ? "caches-extra-info\n" : "",
onion_pkey, identity_pkey,
family_line,
- we_are_hibernating() ? "opt hibernating 1\n" : "",
- options->HidServDirectoryV2 ? "opt hidden-service-dir\n" : "",
- options->AllowSingleHopExits ? "opt allow-single-hop-exits\n" : "");
+ we_are_hibernating() ? "hibernating 1\n" : "",
+ options->HidServDirectoryV2 ? "hidden-service-dir\n" : "",
+ options->AllowSingleHopExits ? "allow-single-hop-exits\n" : "");
tor_free(family_line);
tor_free(onion_pkey);
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index 83c612045..84705d0e0 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -147,9 +147,9 @@ test_dir_formats(void)
"platform Tor "VERSION" on ", sizeof(buf2));
strlcat(buf2, get_uname(), sizeof(buf2));
strlcat(buf2, "\n"
- "opt protocols Link 1 2 Circuit 1\n"
+ "protocols Link 1 2 Circuit 1\n"
"published 1970-01-01 00:00:00\n"
- "opt fingerprint ", sizeof(buf2));
+ "fingerprint ", sizeof(buf2));
test_assert(!crypto_pk_get_fingerprint(pk2, fingerprint, 1));
strlcat(buf2, fingerprint, sizeof(buf2));
strlcat(buf2, "\nuptime 0\n"
@@ -161,7 +161,7 @@ test_dir_formats(void)
strlcat(buf2, pk1_str, sizeof(buf2));
strlcat(buf2, "signing-key\n", sizeof(buf2));
strlcat(buf2, pk2_str, sizeof(buf2));
- strlcat(buf2, "opt hidden-service-dir\n", sizeof(buf2));
+ strlcat(buf2, "hidden-service-dir\n", sizeof(buf2));
strlcat(buf2, "reject *:*\nrouter-signature\n", sizeof(buf2));
buf[strlen(buf2)] = '\0'; /* Don't compare the sig; it's never the same
* twice */