Skip to content

Commit

Permalink
Merge pull request #5085 from AkihiroSuda/fix-related-to-5064
Browse files Browse the repository at this point in the history
Disallow `ADD --checksum=<SUM> <GITSRC> <DST>`
  • Loading branch information
tonistiigi authored Jun 25, 2024
2 parents 05213db + 6b44563 commit 966302e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/dockerfile/dockerfile2llb/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,14 @@ func commonImageNames() []string {
}

func isHTTPSource(src string) bool {
return strings.HasPrefix(src, "http://") || strings.HasPrefix(src, "https://")
if !strings.HasPrefix(src, "http://") && !strings.HasPrefix(src, "https://") {
return false
}
// https://github.com/ORG/REPO.git is a git source, not an http source
if gitRef, gitErr := gitutil.ParseGitRef(src); gitRef != nil && gitErr == nil {
return false
}
return true
}

func isEnabledForStage(stage string, value string) bool {
Expand Down

0 comments on commit 966302e

Please sign in to comment.