From 089137f0112b0ad7c8ada8f2d5c7a967cfb87387 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 2 Nov 2010 11:45:14 -0400 Subject: Fix a bug where seting allow_annotations==0 only ignores annotations, but does not block them --- src/or/routerparse.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/or/routerparse.c') diff --git a/src/or/routerparse.c b/src/or/routerparse.c index aa1aba423..da08e4664 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -1177,10 +1177,16 @@ router_parse_entry_from_string(const char *s, const char *end, s = cp+1; } - if (allow_annotations && start_of_annotations != s) { - if (tokenize_string(area,start_of_annotations,s,tokens, - routerdesc_token_table,TS_NOCHECK)) { - log_warn(LD_DIR, "Error tokenizing router descriptor (annotations)."); + if (start_of_annotations != s) { /* We have annotations */ + if (allow_annotations) { + if (tokenize_string(area,start_of_annotations,s,tokens, + routerdesc_token_table,TS_NOCHECK)) { + log_warn(LD_DIR, "Error tokenizing router descriptor (annotations)."); + goto err; + } + } else { + log_warn(LD_DIR, "Found unexpected annotations on router descriptor not " + "loaded from disk. Dropping it."); goto err; } } -- cgit v1.2.3