@@ -11,6 +11,7 @@ import (
1111 "github.com/dmcgowan/go-tar"
1212 "github.com/opencontainers/runc/libcontainer/system"
1313 "github.com/pkg/errors"
14+ "golang.org/x/sys/unix"
1415)
1516
1617func tarName (p string ) (string , error ) {
@@ -64,9 +65,9 @@ func mkdirAll(path string, perm os.FileMode) error {
6465func prepareApply () func () {
6566 // Unset unmask before doing an apply operation,
6667 // restore unmask when complete
67- oldmask := syscall .Umask (0 )
68+ oldmask := unix .Umask (0 )
6869 return func () {
69- syscall .Umask (oldmask )
70+ unix .Umask (oldmask )
7071 }
7172}
7273
@@ -95,14 +96,14 @@ func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {
9596 mode := uint32 (hdr .Mode & 07777 )
9697 switch hdr .Typeflag {
9798 case tar .TypeBlock :
98- mode |= syscall .S_IFBLK
99+ mode |= unix .S_IFBLK
99100 case tar .TypeChar :
100- mode |= syscall .S_IFCHR
101+ mode |= unix .S_IFCHR
101102 case tar .TypeFifo :
102- mode |= syscall .S_IFIFO
103+ mode |= unix .S_IFIFO
103104 }
104105
105- return syscall .Mknod (path , mode , int (mkdev (hdr .Devmajor , hdr .Devminor )))
106+ return unix .Mknod (path , mode , int (mkdev (hdr .Devmajor , hdr .Devminor )))
106107}
107108
108109func handleLChmod (hdr * tar.Header , path string , hdrInfo os.FileInfo ) error {
@@ -122,7 +123,7 @@ func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {
122123
123124func getxattr (path , attr string ) ([]byte , error ) {
124125 b , err := sysx .LGetxattr (path , attr )
125- if err == syscall .ENOTSUP || err == sysx .ENODATA {
126+ if err == unix .ENOTSUP || err == unix .ENODATA {
126127 return nil , nil
127128 }
128129 return b , err
0 commit comments