Improves how we handle symlinks in plugin management.
(cherry picked from commit 04df634ef5)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
co-authored by
Marcus Efraimsson
parent
e24416e678
commit
aafcd83761
@@ -280,6 +280,34 @@ func TestIsSymlinkRelativeTo(t *testing.T) {
|
||||
symlinkOrigPath: "/dir/sub-dir/test1.txt",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
desc: "Symbolic link pointing to relative file outside basePath should return false",
|
||||
basePath: "/dir",
|
||||
symlinkDestPath: "../../",
|
||||
symlinkOrigPath: "/dir/sub-sir/symlink.txt",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
desc: "Symbolic link pointing to relative file outside basePath should return false",
|
||||
basePath: "/dir",
|
||||
symlinkDestPath: "../..",
|
||||
symlinkOrigPath: "/dir/sub-sir/symlink.txt",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
desc: "Symbolic link pointing to relative file outside basePath should return false",
|
||||
basePath: "/dir",
|
||||
symlinkDestPath: "../../",
|
||||
symlinkOrigPath: "/dir/sub-sir/",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
desc: "Symbolic link pointing to relative file outside basePath should return false",
|
||||
basePath: "/dir",
|
||||
symlinkDestPath: "../..",
|
||||
symlinkOrigPath: "/dir/sub-sir/",
|
||||
expected: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tcs {
|
||||
|
||||
Reference in New Issue
Block a user