archive: make getFileOwner public

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-11-30 15:54:26 +01:00
parent bb2fffc4e2
commit b9ada3d657
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED
3 changed files with 3 additions and 3 deletions

View File

@ -969,7 +969,7 @@ func Unpack(decompressedArchive io.Reader, dest string, options *TarOptions) err
buffer := make([]byte, 1<<20)
if options.ForceMask != nil {
uid, gid, mode, err := getFileOwner(dest)
uid, gid, mode, err := GetFileOwner(dest)
if err == nil {
value := fmt.Sprintf("%d:%d:0%o", uid, gid, mode)
if err := system.Lsetxattr(dest, containersOverrideXattr, []byte(value), 0); err != nil {

View File

@ -163,7 +163,7 @@ func isWhiteOut(stat os.FileInfo) bool {
return major(uint64(s.Rdev)) == 0 && minor(uint64(s.Rdev)) == 0
}
func getFileOwner(path string) (uint32, uint32, uint32, error) {
func GetFileOwner(path string) (uint32, uint32, uint32, error) {
f, err := os.Stat(path)
if err != nil {
return 0, 0, 0, err

View File

@ -6,6 +6,6 @@ func GetWhiteoutConverter(format WhiteoutFormat, data interface{}) TarWhiteoutCo
return nil
}
func getFileOwner(path string) (uint32, uint32, uint32, error) {
func GetFileOwner(path string) (uint32, uint32, uint32, error) {
return 0, 0, 0, nil
}