Skip to content

Commit 97e53f6

Browse files
committed
Some notes about of 'path' will soon have to be amended with more safety (#301)
1 parent de0226a commit 97e53f6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

git-config/src/file/git_config.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,15 @@ impl<'event> GitConfig<'event> {
466466
.map(|v| values::String::from(v).value)
467467
}
468468

469-
/// Like [`value()`][GitConfig::value()], but returning an `Option` if the paty wasn't found.
469+
/// Like [`value()`][GitConfig::value()], but returning an `Option` if the path wasn't found.
470470
///
471-
/// As strings perform no conversions, this will never fail.
471+
/// Note that this path is not vetted and should only point to resources which can't be used
472+
/// to pose a security risk.
473+
///
474+
/// As paths perform no conversions, this will never fail.
475+
// TODO: add `secure_path()` or similar to make use of our knowledge of the trust associated with each configuration
476+
// file, maybe even remove the insecure version to force every caller to ask themselves if the resource can
477+
// be used securely or not.
472478
pub fn path(
473479
&'event self,
474480
section_name: &str,

0 commit comments

Comments
 (0)