ConfigurationSources: Allow config files to be world-readable.

Fixes #475.
This commit is contained in:
Nick Mathewson 2022-05-24 11:05:57 -04:00
parent 85faa1c0f6
commit 5a5a828db6
1 changed files with 6 additions and 1 deletions

View File

@ -159,7 +159,12 @@ where
for (path, must_read) in files {
let required = must_read == &MustRead::MustRead;
match mistrust.verifier().require_file().check(&path) {
match mistrust
.verifier()
.permit_readable()
.require_file()
.check(&path)
{
Ok(()) => {}
Err(fs_mistrust::Error::NotFound(_)) if !required => {}
Err(e) => return Err(ConfigError::Foreign(e.into())),