Cleanup previous PR

This commit is contained in:
Kovid Goyal
2026-04-03 22:25:05 +05:30
parent d8f2d703d7
commit 950497ac0c
5 changed files with 29 additions and 17 deletions

View File

@@ -182,7 +182,8 @@ func ExtractAllFromTar(tr *tar.Reader, dest_path string, optss ...TarExtractOpti
dest_path = filepath.Clean(dest_path)
mode := func(hdr int64) fs.FileMode {
return fs.FileMode(hdr) & fs.ModePerm
// yes, we really want to preserve sticky bits and setuid/setgid bits
return fs.FileMode(hdr) & (fs.ModePerm | fs.ModeSetgid | fs.ModeSetuid | fs.ModeSticky)
}
set_metadata := func(chmod func(mode fs.FileMode) error, hdr_mode int64) (err error) {