Check every hidden service directory's permissions when configuring

Previously, we would only check the last hidden service directory.

Fixes #20529, bugfix on ticket 13942 commit 85bfad1 in 0.2.6.2-alpha.
This commit is contained in:
teor 2016-11-02 14:32:04 +11:00
parent 01fe039b78
commit 1747f28861
No known key found for this signature in database
GPG Key ID: 450CBA7F968F094B
2 changed files with 9 additions and 0 deletions

4
changes/bug20529 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes (hidden services):
- When configuring hidden services, check every hidden service directory's
permissions. Previously, we only checked the last hidden service.
Fixes bug 20529; bugfix on 13942 commit 85bfad1 in 0.2.6.2-alpha.

View File

@ -464,6 +464,11 @@ rend_config_services(const or_options_t *options, int validate_only)
for (line = options->RendConfigLines; line; line = line->next) {
if (!strcasecmp(line->key, "HiddenServiceDir")) {
if (service) { /* register the one we just finished parsing */
if (rend_service_check_private_dir(service, 0) < 0) {
rend_service_free(service);
return -1;
}
if (validate_only)
rend_service_free(service);
else