aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-04-01 20:48:15 -0400
committerNick Mathewson <nickm@torproject.org>2014-04-01 20:48:15 -0400
commitb4b91864bb3879587edc7e8c430337f24835b28c (patch)
tree0e1ba732530a7d35930292ff16507be67c0a5081 /src/or/config.c
parent6bef082d0a6047fd3625f548d60ad257aaed2fab (diff)
parentc4bb3c8d447400573eb45f3e2076e6b80187f1b9 (diff)
downloadtor-b4b91864bb3879587edc7e8c430337f24835b28c.tar
tor-b4b91864bb3879587edc7e8c430337f24835b28c.tar.gz
Merge remote-tracking branch 'public/bug9870'
Conflicts: src/or/config.c
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 909ac145a..c42ceb3d0 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1149,12 +1149,31 @@ options_act_reversible(const or_options_t *old_options, char **msg)
tor_free(severity);
tor_log_update_sigsafe_err_fds();
}
- if (get_min_log_level() >= LOG_INFO &&
- get_min_log_level() != old_min_log_level) {
- log_warn(LD_GENERAL, "Your log may contain sensitive information: you're "
- "logging more than \"notice\". Please log safely. Don't log "
- "unless it serves an important reason, and overwrite the log "
- "afterwards.");
+
+ {
+ const char *badness = NULL;
+ int bad_safelog = 0, bad_severity = 0, new_badness = 0;
+ if (options->SafeLogging_ != SAFELOG_SCRUB_ALL) {
+ bad_safelog = 1;
+ if (!old_options || old_options->SafeLogging_ != options->SafeLogging_)
+ new_badness = 1;
+ }
+ if (get_min_log_level() >= LOG_INFO) {
+ bad_severity = 1;
+ if (get_min_log_level() != old_min_log_level)
+ new_badness = 1;
+ }
+ if (bad_safelog && bad_severity)
+ badness = "you disabled SafeLogging, and "
+ "you're logging more than \"notice\"";
+ else if (bad_safelog)
+ badness = "you disabled SafeLogging";
+ else
+ badness = "you're logging more than \"notice\"";
+ if (new_badness)
+ log_warn(LD_GENERAL, "Your log may contain sensitive information - %s. "
+ "Don't log unless it serves an important reason. "
+ "Overwrite the log afterwards.", badness);
}
SMARTLIST_FOREACH(replaced_listeners, connection_t *, conn,
@@ -1355,13 +1374,6 @@ options_act(const or_options_t *old_options)
"(e.g. set 'ExtORPort auto').");
}
- if (options->SafeLogging_ != SAFELOG_SCRUB_ALL &&
- (!old_options || old_options->SafeLogging_ != options->SafeLogging_)) {
- log_warn(LD_GENERAL, "Your log may contain sensitive information - you "
- "disabled SafeLogging. Please log safely. Don't log unless it "
- "serves an important reason. Overwrite the log afterwards.");
- }
-
if (options->Bridges) {
mark_bridge_list();
for (cl = options->Bridges; cl; cl = cl->next) {