keywords: tar.Xattrs is deprecated by PAXRecords

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2022-04-08 22:48:20 -04:00
parent 3bc8e48538
commit 7b5bbd4eaa
Signed by: vbatts
GPG Key ID: 10937E57733F1362
1 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux
package mtree
@ -69,11 +70,11 @@ var (
}
xattrKeywordFunc = func(path string, info os.FileInfo, r io.Reader) ([]KeyVal, error) {
if hdr, ok := info.Sys().(*tar.Header); ok {
if len(hdr.Xattrs) == 0 {
if len(hdr.PAXRecords) == 0 {
return nil, nil
}
klist := []KeyVal{}
for k, v := range hdr.Xattrs {
for k, v := range hdr.PAXRecords {
encKey, err := govis.Vis(k, DefaultVisFlags)
if err != nil {
return nil, nil