2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-04 18:10:50 +00:00

be more explicit with uid or gid of value -1

This commit is contained in:
Panagiotis Cheilaris 2022-12-28 18:44:36 +01:00
parent 10fa5cde0a
commit 050ed616ae

View File

@ -3,7 +3,6 @@ package dump
import ( import (
"archive/tar" "archive/tar"
"context" "context"
"math"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
@ -39,9 +38,9 @@ const (
cISVTX = 0o1000 // Save text (sticky bit) cISVTX = 0o1000 // Save text (sticky bit)
) )
// substitute a uid or gid of -1 (which is converted to 2^32 - 1) with zero // substitute a uid or gid of -1 (which was converted to 2^32 - 1) with zero
func tarId(id uint32) int { func tarId(id uint32) int {
if id == math.MaxUint32 { if int32(id) == -1 {
return 0 return 0
} }
return int(id) return int(id)