mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-16 02:26:12 +00:00
Set correct ownership during package extraction
This commit is contained in:
@@ -596,6 +596,11 @@ func extractPackage(bpmpkg *BPMPackage, verbose bool, filename, rootDir string)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = os.Chown(extractFilename, header.Uid, header.Gid)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// Using syscall instead of os.Chmod because it seems to strip the setuid, setgid and sticky bits
|
// Using syscall instead of os.Chmod because it seems to strip the setuid, setgid and sticky bits
|
||||||
err := syscall.Chmod(extractFilename, uint32(header.Mode))
|
err := syscall.Chmod(extractFilename, uint32(header.Mode))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -647,6 +652,11 @@ func extractPackage(bpmpkg *BPMPackage, verbose bool, filename, rootDir string)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = os.Chown(extractFilename, header.Uid, header.Gid)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// Using syscall instead of os.Chmod because it seems to strip the setuid, setgid and sticky bits
|
// Using syscall instead of os.Chmod because it seems to strip the setuid, setgid and sticky bits
|
||||||
err = syscall.Chmod(extractFilename, uint32(header.Mode))
|
err = syscall.Chmod(extractFilename, uint32(header.Mode))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user