File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,10 @@ func TestTypes_isAllowedDir(t *testing.T) {
7878 assert.Equal(t, test.allowed, result)
7979 })
8080 }
81+ }
8182
82- t.Run("Test 7: Symlink in allowed directory", func(t *testing.T) {
83+ func TestTypes_isAllowedDirWithSymlink(t *testing.T) {
84+ t.Run("Test 1: Symlink in allowed directory is not allowed", func(t *testing.T) {
8385 allowedDirs := []string{"/etc/nginx"}
8486 filePath := "file.conf"
8587 symlinkPath := "file_link"
@@ -103,8 +105,7 @@ func TestTypes_isAllowedDir(t *testing.T) {
103105 require.NoError(t, err)
104106
105107 result, err := isAllowedDir(symlinkPath, allowedDirs)
106- require.NoError(t, err)
107-
108+ require.Error(t, err)
108109 require.False(t, result, "Symlink in allowed directory should return false")
109110 })
110111}
You can’t perform that action at this time.
0 commit comments