Skip to content

Commit

Permalink
Merge pull request moby#2692 from SvenDowideit/add-specific-feedback-…
Browse files Browse the repository at this point in the history
…for-bad-ADD

Add specific feedback for ADD outside context
  • Loading branch information
Victor Vieux committed Nov 29, 2013
2 parents ff57477 + 96b5be9 commit 926f7b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buildfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func (b *buildFile) addContext(container *Container, orig, dest string) error {
destPath = destPath + "/"
}
if !strings.HasPrefix(origPath, b.context) {
return fmt.Errorf("Forbidden path: %s", origPath)
return fmt.Errorf("Forbidden path outside the build context: %s (%s)", orig, origPath)
}
fi, err := os.Stat(origPath)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion integration/buildfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func TestForbiddenContextPath(t *testing.T) {
t.Fail()
}

if err.Error() != "Forbidden path: /" {
if err.Error() != "Forbidden path outside the build context: ../../ (/)" {
t.Logf("Error message is not expected: %s", err.Error())
t.Fail()
}
Expand Down

0 comments on commit 926f7b5

Please sign in to comment.