Ensure that the source dir is marked safe for newer versions of git #50
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.
Description
Newer versions of git can complain about an unsafe
/source
dir if the owner of the directory is different than the current owner. See https://github.blog/2022-04-12-git-security-vulnerability-announced/#cve-2022-24765 for more info. This is not applicable to buildrunner invocations since they are run in docker images specified by the user. Therefore we always mark the git directory as safe before any commands are executed. This may not catch ALL cases where it is needed (i.e. entrypoint of the image triggers the issue), but it should cover a majority of cases. Any other cases will need to be handled by the user in their images by using the same (or similar)git config
command.Related Issue
Motivation and Context
See the description above for context.
How Has This Been Tested?
A functional test file was added that triggers the behavior. Without the fix, it fails, with the fix, it succeeds.
Screenshots (if appropriate):
Types of changes
Checklist: