From 050ed616ae4ed68d75a5e9b7453caa1310f842d5 Mon Sep 17 00:00:00 2001 From: Panagiotis Cheilaris Date: Wed, 28 Dec 2022 18:44:36 +0100 Subject: [PATCH] be more explicit with uid or gid of value -1 --- internal/dump/tar.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/dump/tar.go b/internal/dump/tar.go index 0e4b83290..aa8064fe1 100644 --- a/internal/dump/tar.go +++ b/internal/dump/tar.go @@ -3,7 +3,6 @@ package dump import ( "archive/tar" "context" - "math" "os" "path/filepath" "strings" @@ -39,9 +38,9 @@ const ( 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 { - if id == math.MaxUint32 { + if int32(id) == -1 { return 0 } return int(id)