diff options
author | Glen Choo <chooglen@google.com> | 2022-07-14 23:28:00 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-15 00:08:29 +0200 |
commit | 6061601d9f1f1c95da5f9304c319218f7cc3ec75 (patch) | |
tree | 34511fef78126c405e81fbc6d170f672ae4505ab /Documentation | |
parent | config: learn `git_protected_config()` (diff) | |
download | git-6061601d9f1f1c95da5f9304c319218f7cc3ec75.tar.xz git-6061601d9f1f1c95da5f9304c319218f7cc3ec75.zip |
safe.directory: use git_protected_config()
Use git_protected_config() to read `safe.directory` instead of
read_very_early_config(), making it 'protected configuration only'.
As a result, `safe.directory` now respects "-c", so update the tests and
docs accordingly. It used to ignore "-c" due to how it was implemented,
not because of security or correctness concerns [1].
[1] https://lore.kernel.org/git/xmqqlevabcsu.fsf@gitster.g/
Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config/safe.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/config/safe.txt b/Documentation/config/safe.txt index fa02f3ccc5..f72b440879 100644 --- a/Documentation/config/safe.txt +++ b/Documentation/config/safe.txt @@ -12,9 +12,9 @@ via `git config --add`. To reset the list of safe directories (e.g. to override any such directories specified in the system config), add a `safe.directory` entry with an empty value. + -This config setting is only respected when specified in a system or global -config, not when it is specified in a repository config, via the command -line option `-c safe.directory=<path>`, or in environment variables. +This config setting is only respected in protected configuration (see +<<SCOPES>>). This prevents the untrusted repository from tampering with this +value. + The value of this setting is interpolated, i.e. `~/<path>` expands to a path relative to the home directory and `%(prefix)/<path>` expands to a |