diff options
author | Daniel 'koolfy' Faucon <koolfy@geekmx.org> | 2012-04-07 23:56:52 +0200 |
---|---|---|
committer | Daniel 'koolfy' Faucon <koolfy@geekmx.org> | 2012-04-07 23:56:52 +0200 |
commit | ce5422ecd14ed9911abfe9c44897d93afb2cf05a (patch) | |
tree | 88a64918df2a54d22ce082a90bffc8916ad52c3d /src | |
parent | 15ac8c5711fdbf5f1327368be20e62776ccda45f (diff) | |
download | tor-ce5422ecd14ed9911abfe9c44897d93afb2cf05a.tar tor-ce5422ecd14ed9911abfe9c44897d93afb2cf05a.tar.gz |
fix bug 5572
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index 8cbdf9b8a..75a1bd2df 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1332,6 +1332,7 @@ options_act(const or_options_t *old_options) or_options_t *options = get_options_mutable(); int running_tor = options->command == CMD_RUN_TOR; char *msg; + char *keydir; const int transition_affects_workers = old_options && options_transition_affects_workers(old_options, options); @@ -1462,6 +1463,12 @@ options_act(const or_options_t *old_options) if (!old_options) { if (options->DynamicDHGroups) { char *fname = get_datadir_fname2("keys", "dynamic_dh_params"); + keydir = get_datadir_fname("keys"); + if (check_private_dir(keydir, CPD_CREATE, options->User)) { + tor_free(keydir); + return -1; + } + tor_free(keydir); crypto_set_tls_dh_prime(fname); tor_free(fname); } else { @@ -1470,6 +1477,12 @@ options_act(const or_options_t *old_options) } else { if (options->DynamicDHGroups && !old_options->DynamicDHGroups) { char *fname = get_datadir_fname2("keys", "dynamic_dh_params"); + keydir = get_datadir_fname("keys"); + if (check_private_dir(keydir, CPD_CREATE, options->User)) { + tor_free(keydir); + return -1; + } + tor_free(keydir); crypto_set_tls_dh_prime(fname); tor_free(fname); } else if (!options->DynamicDHGroups && old_options->DynamicDHGroups) { |