|
@@ -8,12 +8,12 @@ import (
|
|
"path/filepath"
|
|
"path/filepath"
|
|
"sort"
|
|
"sort"
|
|
"strings"
|
|
"strings"
|
|
- "syscall"
|
|
|
|
|
|
|
|
log "github.com/Sirupsen/logrus"
|
|
log "github.com/Sirupsen/logrus"
|
|
"github.com/docker/docker/daemon/execdriver"
|
|
"github.com/docker/docker/daemon/execdriver"
|
|
"github.com/docker/docker/pkg/chrootarchive"
|
|
"github.com/docker/docker/pkg/chrootarchive"
|
|
"github.com/docker/docker/pkg/symlink"
|
|
"github.com/docker/docker/pkg/symlink"
|
|
|
|
+ "github.com/docker/docker/pkg/system"
|
|
"github.com/docker/docker/volumes"
|
|
"github.com/docker/docker/volumes"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -385,15 +385,14 @@ func copyExistingContents(source, destination string) error {
|
|
// copyOwnership copies the permissions and uid:gid of the source file
|
|
// copyOwnership copies the permissions and uid:gid of the source file
|
|
// into the destination file
|
|
// into the destination file
|
|
func copyOwnership(source, destination string) error {
|
|
func copyOwnership(source, destination string) error {
|
|
- var stat syscall.Stat_t
|
|
|
|
-
|
|
|
|
- if err := syscall.Stat(source, &stat); err != nil {
|
|
|
|
|
|
+ stat, err := system.Stat(source)
|
|
|
|
+ if err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
- if err := os.Chown(destination, int(stat.Uid), int(stat.Gid)); err != nil {
|
|
|
|
|
|
+ if err := os.Chown(destination, int(stat.Uid()), int(stat.Gid())); err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
- return os.Chmod(destination, os.FileMode(stat.Mode))
|
|
|
|
|
|
+ return os.Chmod(destination, os.FileMode(stat.Mode()))
|
|
}
|
|
}
|