diff options
author | David Goulet <dgoulet@torproject.org> | 2017-01-17 14:40:01 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-01-17 14:40:01 -0500 |
commit | e16148a58218177411939e373d96aa4f152cadc8 (patch) | |
tree | 4782e9a61bebb9559b6f8126278f4242f87dd0e5 /src/or/routerkeys.c | |
parent | 92c3926479de1511dc4607fdc1f9b8fa0fa9f47b (diff) | |
download | tor-e16148a58218177411939e373d96aa4f152cadc8.tar.gz tor-e16148a58218177411939e373d96aa4f152cadc8.zip |
relay: Honor DataDirectoryGroupReadable at key init
Our config code is checking correctly at DataDirectoryGroupReadable but then
when we initialize the keys, we ignored that option ending up at setting back
the DataDirectory to 0700 instead of 0750. Patch by "redfish".
Fixes #19953
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/routerkeys.c')
-rw-r--r-- | src/or/routerkeys.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index 51802b15e5..e20787123e 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -785,8 +785,11 @@ load_ed_keys(const or_options_t *options, time_t now) if (options->command == CMD_KEYGEN) flags |= INIT_ED_KEY_TRY_ENCRYPTED; - /* Check the key directory */ - if (check_private_dir(options->DataDirectory, CPD_CREATE, options->User)) { + /* Check/Create the key directory */ + cpd_check_t cpd_opts = CPD_CREATE; + if (options->DataDirectoryGroupReadable) + cpd_opts |= CPD_GROUP_READ; + if (check_private_dir(options->DataDirectory, cpd_opts, options->User)) { log_err(LD_OR, "Can't create/check datadirectory %s", options->DataDirectory); goto err; |