ignore sockets when adding to tar (#288)

This commit is contained in:
priyawadhwa 2018-08-13 11:26:30 -07:00 committed by GitHub
parent 93d139c5fe
commit 3a9b4fe612
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,10 @@ func AddToTar(p string, i os.FileInfo, hardlinks map[uint64]string, w *tar.Write
return err
}
}
if i.Mode()&os.ModeSocket != 0 {
logrus.Infof("ignoring socket %s, not adding to tar", i.Name())
return nil
}
hdr, err := tar.FileInfoHeader(i, linkDst)
if err != nil {
return err