diff options
author | teor <teor@torproject.org> | 2019-10-23 22:59:16 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-10-23 22:59:16 +1000 |
commit | 34509e78c6280a103eb243865ce52a70f4a665d0 (patch) | |
tree | 8ef73ca409b1fe2e5c85d0c1a171fe8d40345606 /src/app/config/config.c | |
parent | 71191fa3dcc29d24aee9a22d1d9f2584316e818f (diff) | |
parent | 04addabb0426f2f564f4f0914568b2fa227a8f54 (diff) | |
download | tor-34509e78c6280a103eb243865ce52a70f4a665d0.tar.gz tor-34509e78c6280a103eb243865ce52a70f4a665d0.zip |
Merge remote-tracking branch 'tor-github/pr/1449'
Diffstat (limited to 'src/app/config/config.c')
-rw-r--r-- | src/app/config/config.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 68305aa65a..02c39c98ef 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -843,9 +843,8 @@ static int parse_outbound_addresses(or_options_t *options, int validate_only, char **msg); static void config_maybe_load_geoip_files_(const or_options_t *options, const or_options_t *old_options); -static int options_validate_cb(void *old_options, void *options, - void *default_options, - int from_setconf, char **msg); +static int options_validate_cb(const void *old_options, void *options, + char **msg); static void cleanup_protocol_warning_severity_level(void); static void set_protocol_warning_severity_level(int warning_severity); static void options_clear_cb(const config_mgr_t *mgr, void *opts); @@ -1228,7 +1227,8 @@ add_default_fallback_dir_servers,(void)) * user if we changed any dangerous ones. */ static int -validate_dir_servers(or_options_t *options, or_options_t *old_options) +validate_dir_servers(const or_options_t *options, + const or_options_t *old_options) { config_line_t *cl; @@ -2682,7 +2682,7 @@ options_trial_assign(config_line_t *list, unsigned flags, char **msg) in_option_validation = 1; if (options_validate(cur_options, trial_options, - global_default_options, 1, msg) < 0) { + msg) < 0) { or_options_free(trial_options); rv = SETOPT_ERR_PARSE; /*XXX make this a separate return value. */ goto done; @@ -3231,12 +3231,10 @@ compute_publishserverdescriptor(or_options_t *options) #define RECOMMENDED_MIN_CIRCUIT_BUILD_TIMEOUT (10) static int -options_validate_cb(void *old_options, void *options, void *default_options, - int from_setconf, char **msg) +options_validate_cb(const void *old_options, void *options, char **msg) { in_option_validation = 1; - int rv = options_validate(old_options, options, default_options, - from_setconf, msg); + int rv = options_validate(old_options, options, msg); in_option_validation = 0; return rv; } @@ -3433,16 +3431,13 @@ options_validate_single_onion(or_options_t *options, char **msg) * On error, tor_strdup an error explanation into *<b>msg</b>. */ STATIC int -options_validate(or_options_t *old_options, or_options_t *options, - or_options_t *default_options_unused, int from_setconf_unused, +options_validate(const or_options_t *old_options, or_options_t *options, char **msg) { config_line_t *cl; const char *uname = get_uname(); int n_ports=0; int world_writable_control_socket=0; - (void)from_setconf_unused; /* 29211 TODO: Remove this from the API. */ - (void)default_options_unused; /* 29211 TODO: Remove this from the API. */ tor_assert(msg); *msg = NULL; @@ -5522,8 +5517,7 @@ options_init_from_string(const char *cf_defaults, const char *cf, newoptions->FilesOpenedByIncludes = opened_files; /* Validate newoptions */ - if (options_validate(oldoptions, newoptions, newdefaultoptions, - 0, msg) < 0) { + if (options_validate(oldoptions, newoptions, msg) < 0) { err = SETOPT_ERR_PARSE; /*XXX make this a separate return value.*/ goto err; } |