refactor: Rewrite path sanitizer to support write operations on relative tar archives

This commit is contained in:
Felix Pojtinger
2022-01-04 22:20:33 +01:00
parent 0161a0ae6a
commit 6b48db10f7
3 changed files with 129 additions and 96 deletions
+9
View File
@@ -349,6 +349,9 @@ func (f *File) Name() string {
"name": f.name,
})
f.ioLock.Lock()
defer f.ioLock.Unlock()
return f.name
}
@@ -357,6 +360,9 @@ func (f *File) Stat() (os.FileInfo, error) {
"name": f.name,
})
f.ioLock.Lock()
defer f.ioLock.Unlock()
return f.info, nil
}
@@ -366,6 +372,9 @@ func (f *File) Readdir(count int) ([]os.FileInfo, error) {
"count": count,
})
f.ioLock.Lock()
defer f.ioLock.Unlock()
hdrs, err := inventory.List(
f.metadata,