Enforce the egg's file denylist more thoroughly

Closes pterodactyl/panel#5042
This commit is contained in:
Victor B.
2024-03-25 15:49:34 +01:00
parent 1f77d2256b
commit e7139a9dc9
4 changed files with 33 additions and 0 deletions

View File

@@ -28,6 +28,11 @@ import (
// and the compressed file will be placed at that location named
// `archive-{date}.tar.gz`.
func (fs *Filesystem) CompressFiles(dir string, paths []string) (ufs.FileInfo, error) {
for _, file := range paths {
if err := fs.IsIgnored(path.Join(dir, file)); err != nil {
return nil, err
}
}
a := &Archive{Filesystem: fs, BaseDirectory: dir, Files: paths}
d := path.Join(
dir,