Skip over directory entries with no read permission#228
Open
dtolnay wants to merge 2 commits intorustls:mainfrom
Open
Skip over directory entries with no read permission#228dtolnay wants to merge 2 commits intorustls:mainfrom
dtolnay wants to merge 2 commits intorustls:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some systems have certificates that are intended to be only readable by root. I came across this with the following error from rustls-native-certs:
In my experience, at least with Linux, it is an expectation that tools that load information from arbitrarily many files in a directory will skip over files lacking read permission for the current user. For example the
/etc/profilein Debian systems contains the following logic using[ -r("True if file is readable by you") to skip unreadable files — this makes it convenient to disable individual scripts temporarily usingchmod -rand re-enable usingchmod +r.https://salsa.debian.org/sanvila/base-files/-/blob/master/share/profile
Another example,
fc-cacheskips font files without read permission in.local/share/fonts.This is not something that can be implemented downstream of this crate, because the caller of
rustls_native_certs::load_native_certs()cannot tell in general whether a PermissionDenied error in CertificateResult.errors originates from loading SSL_CERT_FILE (which we do not want to ignore) vs SSL_CERT_DIR (this PR ignores), without reimplementing much of rustls-native-certs.