[tor-commits] [tor/master] Handle __NonSavedOptions correctly inside LINELIST_V blocks.

nickm at torproject.org nickm at torproject.org
Mon Jan 23 21:07:22 UTC 2017


commit 9469aaaa82b353655c8e17f654954231ba3b09c8
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Jan 18 10:24:37 2017 -0500

    Handle __NonSavedOptions correctly inside LINELIST_V blocks.
---
 src/or/confparse.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/or/confparse.c b/src/or/confparse.c
index efcf4f9..2d6cc7a 100644
--- a/src/or/confparse.c
+++ b/src/or/confparse.c
@@ -1148,6 +1148,11 @@ config_dump(const config_format_t *fmt, const void *default_options,
       config_get_assigned_option(fmt, options, fmt->vars[i].name, 1);
 
     for (; line; line = line->next) {
+      if (!strcmpstart(line->key, "__")) {
+        /* This check detects "hidden" variables inside LINELIST_V structures.
+         */
+        continue;
+      }
       smartlist_add_asprintf(elements, "%s%s %s\n",
                    comment_option ? "# " : "",
                    line->key, line->value);





More information about the tor-commits mailing list