Adding test case for symlink causes infinit loop, reproduces: dotcloud#5370
normally symlinks are created as either ln -s /path/existing /path/new-name or cd /path && ln -s ./existing new-name but one can create it this way cd /path && ln -s existing new-name this drives FollowSymlinkInScope into infinite loop Docker-DCO-1.1-Signed-off-by: Lajos Papp <lajos.papp@sequenceiq.com> (github: lalyos)
This commit is contained in:
parent
9b677d0733
commit
64b6d99e35
2 changed files with 14 additions and 0 deletions
|
@ -28,6 +28,19 @@ func TestFollowSymLinkNormal(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestFollowSymLinkRelativePath(t *testing.T) {
|
||||
link := "testdata/fs/i"
|
||||
|
||||
rewrite, err := FollowSymlinkInScope(link, "testdata")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if expected := abs(t, "testdata/fs/a"); expected != rewrite {
|
||||
t.Fatalf("Expected %s got %s", expected, rewrite)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFollowSymLinkUnderLinkedDir(t *testing.T) {
|
||||
dir, err := ioutil.TempDir("", "docker-fs-test")
|
||||
if err != nil {
|
||||
|
|
1
symlink/testdata/fs/i
vendored
Symbolic link
1
symlink/testdata/fs/i
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
a
|
Loading…
Reference in a new issue