Files
docker-cli/components/engine/daemon/volumes_linux.go
John Howard ca495f5d0d Windows: Refactor volumes
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ba1725a94ee75603d3a21e0580be3954fc689137
Component: engine
2015-04-27 09:27:15 -07:00

25 lines
473 B
Go

// +build !windows
package daemon
import (
"os"
"github.com/docker/docker/pkg/system"
)
// copyOwnership copies the permissions and uid:gid of the source file
// into the destination file
func copyOwnership(source, destination string) error {
stat, err := system.Stat(source)
if err != nil {
return err
}
if err := os.Chown(destination, int(stat.Uid()), int(stat.Gid())); err != nil {
return err
}
return os.Chmod(destination, os.FileMode(stat.Mode()))
}