mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-10-31 11:01:48 +00:00
Set correct ownership during package extraction
This commit is contained in:
1 parent
6492fd028f
commit
e63398c853
1 file changed
+10
@@ -596,6 +596,11 @@ func extractPackage(bpmpkg *BPMPackage, verbose bool, filename, rootDir string)
|
||||
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
|
||||
err := syscall.Chmod(extractFilename, uint32(header.Mode))
|
||||
if err != nil {
|
||||
@@ -647,6 +652,11 @@ func extractPackage(bpmpkg *BPMPackage, verbose bool, filename, rootDir string)
|
||||
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
|
||||
err = syscall.Chmod(extractFilename, uint32(header.Mode))
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user