aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-01-17 14:40:01 -0500
committerDavid Goulet <dgoulet@torproject.org>2017-01-17 14:40:01 -0500
commite16148a58218177411939e373d96aa4f152cadc8 (patch)
tree4782e9a61bebb9559b6f8126278f4242f87dd0e5 /src/or/router.c
parent92c3926479de1511dc4607fdc1f9b8fa0fa9f47b (diff)
downloadtor-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/router.c')
-rw-r--r--src/or/router.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 2d8208aa04..e4fa72a283 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -849,7 +849,12 @@ init_keys(void)
if (init_keys_common() < 0)
return -1;
/* Make sure DataDirectory exists, and is private. */
- if (check_private_dir(options->DataDirectory, CPD_CREATE, options->User)) {
+ 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);
return -1;
}
/* Check the key directory. */