|
@@ -5,6 +5,8 @@ package chrootarchive // import "github.com/docker/docker/pkg/chrootarchive"
|
|
|
|
|
|
import (
|
|
|
"io"
|
|
|
+ "net"
|
|
|
+ "os/user"
|
|
|
"path/filepath"
|
|
|
"strings"
|
|
|
|
|
@@ -12,6 +14,13 @@ import (
|
|
|
"github.com/pkg/errors"
|
|
|
)
|
|
|
|
|
|
+func init() {
|
|
|
+ // initialize nss libraries in Glibc so that the dynamic libraries are loaded in the host
|
|
|
+ // environment not in the chroot from untrusted files.
|
|
|
+ _, _ = user.Lookup("docker")
|
|
|
+ _, _ = net.LookupHost("localhost")
|
|
|
+}
|
|
|
+
|
|
|
func invokeUnpack(decompressedArchive io.Reader, dest string, options *archive.TarOptions, root string) error {
|
|
|
relDest, err := resolvePathInChroot(root, dest)
|
|
|
if err != nil {
|