2021-08-23 09:14:53 -04:00
|
|
|
//go:build !windows && !linux
|
2016-05-04 13:32:51 -04:00
|
|
|
// +build !windows,!linux
|
|
|
|
|
2018-02-05 16:05:59 -05:00
|
|
|
package chrootarchive // import "github.com/docker/docker/pkg/chrootarchive"
|
2016-05-04 13:32:51 -04:00
|
|
|
|
2017-05-23 10:22:32 -04:00
|
|
|
import "golang.org/x/sys/unix"
|
2016-05-04 13:32:51 -04:00
|
|
|
|
|
|
|
func chroot(path string) error {
|
2017-05-23 10:22:32 -04:00
|
|
|
if err := unix.Chroot(path); err != nil {
|
2016-05-04 13:32:51 -04:00
|
|
|
return err
|
|
|
|
}
|
2017-05-23 10:22:32 -04:00
|
|
|
return unix.Chdir("/")
|
2016-05-04 13:32:51 -04:00
|
|
|
}
|
2019-07-03 17:36:48 -04:00
|
|
|
|
|
|
|
func realChroot(path string) error {
|
|
|
|
return chroot(path)
|
|
|
|
}
|