diff options
author | Nick Mathewson <nickm@torproject.org> | 2021-07-01 09:56:35 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2021-07-01 09:56:35 -0400 |
commit | e71db3a4be1cab933f721d63d4ed98f50dddd7c0 (patch) | |
tree | b46190badc04e1c03f9696b6420f8a1b436be91a | |
parent | 48ee68656a66940d321d412b8d7e6c21b8fa6b1a (diff) | |
parent | f944e463995fa2e4c04e6d732ec77e66bb1a6f8a (diff) | |
download | tor-e71db3a4be1cab933f721d63d4ed98f50dddd7c0.tar.gz tor-e71db3a4be1cab933f721d63d4ed98f50dddd7c0.zip |
Merge remote-tracking branch 'tor-gitlab/mr/405'
-rw-r--r-- | changes/issue40338 | 3 | ||||
-rw-r--r-- | src/feature/hs/hs_config.c | 22 |
2 files changed, 16 insertions, 9 deletions
diff --git a/changes/issue40338 b/changes/issue40338 new file mode 100644 index 0000000000..bc2cafff61 --- /dev/null +++ b/changes/issue40338 @@ -0,0 +1,3 @@ + o Minor features (testing configuration): + - When TestingTorNetwork is enabled, skip the permission check on + the hidden service directory. Closes ticket 40338. diff --git a/src/feature/hs/hs_config.c b/src/feature/hs/hs_config.c index 68ed932701..f9f71c78f2 100644 --- a/src/feature/hs/hs_config.c +++ b/src/feature/hs/hs_config.c @@ -544,15 +544,19 @@ config_service(config_line_t *line, const or_options_t *options, tor_assert(service->config.version <= HS_VERSION_MAX); - /* Check permission on service directory that was just parsed. And this must - * be done regardless of the service version. Do not ask for the directory - * to be created, this is done when the keys are loaded because we could be - * in validation mode right now. */ - if (hs_check_service_private_dir(options->User, - service->config.directory_path, - service->config.dir_group_readable, - 0) < 0) { - goto err; + /* If we're running with TestingTorNetwork enabled, we relax the permissions + * check on the hs directory. */ + if (!options->TestingTorNetwork) { + /* Check permission on service directory that was just parsed. And this + * must be done regardless of the service version. Do not ask for the + * directory to be created, this is done when the keys are loaded because + * we could be in validation mode right now. */ + if (hs_check_service_private_dir(options->User, + service->config.directory_path, + service->config.dir_group_readable, + 0) < 0) { + goto err; + } } /* We'll try to learn the service version here by loading the key(s) if |