File tree Expand file tree Collapse file tree 5 files changed +2
-35
lines changed
good/extension1/rootfs/usr/local/lib Expand file tree Collapse file tree 5 files changed +2
-35
lines changed Original file line number Diff line number Diff line change @@ -76,10 +76,6 @@ func TestValidateFailures(t *testing.T) {
76
76
name : "norootfs" ,
77
77
loadError : "extension rootfs is missing" ,
78
78
},
79
- {
80
- name : "symlinks" ,
81
- validateError : "symlinks are not allowed: \" /usr/local/b\" " ,
82
- },
83
79
{
84
80
name : "badpaths" ,
85
81
validateError : "path \" /boot/vmlinuz\" is not allowed in extensions" ,
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ a.so
Original file line number Diff line number Diff line change @@ -70,11 +70,6 @@ func (ext *Extension) validateContents() error {
70
70
return fmt .Errorf ("world-writeable files are not allowed: %q" , itemPath )
71
71
}
72
72
73
- // no symlinks
74
- if d .Type ().Type () == os .ModeSymlink {
75
- return fmt .Errorf ("symlinks are not allowed: %q" , itemPath )
76
- }
77
-
78
73
var st fs.FileInfo
79
74
80
75
st , err = d .Info ()
@@ -88,24 +83,10 @@ func (ext *Extension) validateContents() error {
88
83
}
89
84
90
85
// no special files
91
- if ! d .IsDir () && ! d .Type ().IsRegular () {
86
+ if ! d .IsDir () && ! d .Type ().IsRegular () && d . Type (). Type () != os . ModeSymlink {
92
87
return fmt .Errorf ("special files are not allowed: %q" , itemPath )
93
88
}
94
89
95
- // directories should be non-empty
96
- if d .IsDir () {
97
- var contents []fs.DirEntry
98
-
99
- contents , err = os .ReadDir (path )
100
- if err != nil {
101
- return err
102
- }
103
-
104
- if len (contents ) == 0 {
105
- return fmt .Errorf ("empty directories are not allowed: %q" , itemPath )
106
- }
107
- }
108
-
109
90
// regular file: check for file path being whitelisted
110
91
if ! d .IsDir () {
111
92
dirPath := filepath .Dir (itemPath )
You can’t perform that action at this time.
0 commit comments