archive: make getFileOwner public
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
bb2fffc4e2
commit
b9ada3d657
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue