convert uid/gid -1 to 0 only in 32-bit tar dump

Only for a 32-bit build of restic, convert a uid or gid value of -1 to 0.
This commit is contained in:
Panagiotis Cheilaris
2022-12-30 18:12:12 +01:00
parent a86a56cf3b
commit 3b516d4b70
2 changed files with 7 additions and 9 deletions

View File

@@ -38,9 +38,10 @@ const (
cISVTX = 0o1000 // Save text (sticky bit)
)
// substitute a uid or gid of -1 (which was converted to 2^32 - 1) with zero
// in a 32-bit build of restic:
// substitute a uid or gid of -1 (which was converted to 2^32 - 1) with 0
func tarIdentifier(id uint32) int {
if int32(id) == -1 {
if int(id) == -1 {
return 0
}
return int(id)