diff options
Diffstat (limited to 'src/app/config')
-rw-r--r-- | src/app/config/config.c | 19 | ||||
-rw-r--r-- | src/app/config/config.h | 10 |
2 files changed, 24 insertions, 5 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 6b9162a3df..803a0eda54 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -1056,10 +1056,14 @@ config_free_all(void) * (We return "[scrubbed]" if SafeLogging is "1", and address otherwise.) */ const char * -safe_str_client(const char *address) +safe_str_client_opts(const or_options_t *options, const char *address) { tor_assert(address); - if (get_options()->SafeLogging_ == SAFELOG_SCRUB_ALL) + if (!options) { + options = get_options(); + } + + if (options->SafeLogging_ == SAFELOG_SCRUB_ALL) return "[scrubbed]"; else return address; @@ -1073,10 +1077,14 @@ safe_str_client(const char *address) * otherwise.) */ const char * -safe_str(const char *address) +safe_str_opts(const or_options_t *options, const char *address) { tor_assert(address); - if (get_options()->SafeLogging_ != SAFELOG_SCRUB_NONE) + if (!options) { + options = get_options(); + } + + if (options->SafeLogging_ != SAFELOG_SCRUB_NONE) return "[scrubbed]"; else return address; @@ -3546,7 +3554,8 @@ options_validate(or_options_t *old_options, or_options_t *options, "(Bridge/V3)AuthoritativeDir is set."); /* If we have a v3bandwidthsfile and it's broken, complain on startup */ if (options->V3BandwidthsFile && !old_options) { - dirserv_read_measured_bandwidths(options->V3BandwidthsFile, NULL, NULL); + dirserv_read_measured_bandwidths(options->V3BandwidthsFile, NULL, NULL, + NULL); } /* same for guardfraction file */ if (options->GuardfractionFile && !old_options) { diff --git a/src/app/config/config.h b/src/app/config/config.h index b3b3150825..46db02f944 100644 --- a/src/app/config/config.h +++ b/src/app/config/config.h @@ -141,6 +141,16 @@ MOCK_DECL(char *, #define get_cachedir_fname_suffix(sub1, suffix) \ options_get_cachedir_fname2_suffix(get_options(), (sub1), NULL, (suffix)) +#define safe_str_client(address) \ + safe_str_client_opts(NULL, address) +#define safe_str(address) \ + safe_str_opts(NULL, address) + +const char * safe_str_client_opts(const or_options_t *options, + const char *address); +const char * safe_str_opts(const or_options_t *options, + const char *address); + int using_default_dir_authorities(const or_options_t *options); int create_keys_directory(const or_options_t *options); |