server(fs): keep file mode when extracting archive

This commit is contained in:
Matthew Penner
2021-07-15 15:37:38 -06:00
parent f422081695
commit 31ff3f8b56
5 changed files with 23 additions and 10 deletions

View File

@@ -132,6 +132,10 @@ func (fs *Filesystem) DecompressFile(dir string, file string) error {
if err := fs.Writefile(p, f); err != nil {
return wrapError(err, source)
}
// Update the file permissions to the one set in the archive.
if err := fs.Chmod(p, f.Mode()); err != nil {
return wrapError(err, source)
}
return nil
})
if err != nil {