mirror of
https://github.com/containers/podman.git
synced 2025-12-02 19:28:58 +08:00
Vendor in containers/(storage,image, common, buildah)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
13
vendor/github.com/containers/buildah/copier/syscall_unix.go
generated
vendored
13
vendor/github.com/containers/buildah/copier/syscall_unix.go
generated
vendored
@@ -1,13 +1,14 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package copier
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
@@ -16,13 +17,13 @@ var canChroot = os.Getuid() == 0
|
||||
func chroot(root string) (bool, error) {
|
||||
if canChroot {
|
||||
if err := os.Chdir(root); err != nil {
|
||||
return false, errors.Wrapf(err, "error changing to intended-new-root directory %q", root)
|
||||
return false, fmt.Errorf("error changing to intended-new-root directory %q: %w", root, err)
|
||||
}
|
||||
if err := unix.Chroot(root); err != nil {
|
||||
return false, errors.Wrapf(err, "error chrooting to directory %q", root)
|
||||
return false, fmt.Errorf("error chrooting to directory %q: %w", root, err)
|
||||
}
|
||||
if err := os.Chdir(string(os.PathSeparator)); err != nil {
|
||||
return false, errors.Wrapf(err, "error changing to just-became-root directory %q", root)
|
||||
return false, fmt.Errorf("error changing to just-became-root directory %q: %w", root, err)
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
@@ -45,10 +46,6 @@ func mkfifo(path string, mode uint32) error {
|
||||
return unix.Mkfifo(path, mode)
|
||||
}
|
||||
|
||||
func mknod(path string, mode uint32, dev int) error {
|
||||
return unix.Mknod(path, mode, dev)
|
||||
}
|
||||
|
||||
func chmod(path string, mode os.FileMode) error {
|
||||
return os.Chmod(path, mode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user