mirror of
https://github.com/containers/podman.git
synced 2025-12-11 17:27:19 +08:00
vendor: bump c/common to v0.49.2-0.20220929111928-2d1b45ae2423
[NO NEW TESTS NEEDED] [NO TESTS NEEDED] Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
5
vendor/github.com/containers/storage/pkg/system/mknod.go
generated
vendored
5
vendor/github.com/containers/storage/pkg/system/mknod.go
generated
vendored
@@ -1,3 +1,4 @@
|
||||
//go:build !windows && !freebsd
|
||||
// +build !windows,!freebsd
|
||||
|
||||
package system
|
||||
@@ -8,8 +9,8 @@ import (
|
||||
|
||||
// Mknod creates a filesystem node (file, device special file or named pipe) named path
|
||||
// with attributes specified by mode and dev.
|
||||
func Mknod(path string, mode uint32, dev int) error {
|
||||
return unix.Mknod(path, mode, dev)
|
||||
func Mknod(path string, mode uint32, dev uint32) error {
|
||||
return unix.Mknod(path, mode, int(dev))
|
||||
}
|
||||
|
||||
// Mkdev is used to build the value of linux devices (in /dev/) which specifies major
|
||||
|
||||
5
vendor/github.com/containers/storage/pkg/system/mknod_freebsd.go
generated
vendored
5
vendor/github.com/containers/storage/pkg/system/mknod_freebsd.go
generated
vendored
@@ -1,3 +1,4 @@
|
||||
//go:build freebsd
|
||||
// +build freebsd
|
||||
|
||||
package system
|
||||
@@ -17,6 +18,6 @@ func Mknod(path string, mode uint32, dev uint64) error {
|
||||
// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes.
|
||||
// They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major,
|
||||
// then the top 12 bits of the minor.
|
||||
func Mkdev(major int64, minor int64) uint32 {
|
||||
return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff))
|
||||
func Mkdev(major int64, minor int64) uint64 {
|
||||
return uint64(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff))
|
||||
}
|
||||
|
||||
3
vendor/github.com/containers/storage/pkg/system/rm.go
generated
vendored
3
vendor/github.com/containers/storage/pkg/system/rm.go
generated
vendored
@@ -35,6 +35,9 @@ func EnsureRemoveAll(dir string) error {
|
||||
}
|
||||
|
||||
for {
|
||||
if err := resetFileFlags(dir); err != nil {
|
||||
return fmt.Errorf("resetting file flags: %w", err)
|
||||
}
|
||||
err := os.RemoveAll(dir)
|
||||
if err == nil {
|
||||
return nil
|
||||
|
||||
10
vendor/github.com/containers/storage/pkg/system/rm_common.go
generated
vendored
Normal file
10
vendor/github.com/containers/storage/pkg/system/rm_common.go
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
//go:build !freebsd
|
||||
// +build !freebsd
|
||||
|
||||
package system
|
||||
|
||||
// Reset file flags in a directory tree. This allows EnsureRemoveAll
|
||||
// to delete trees which have the immutable flag set.
|
||||
func resetFileFlags(dir string) error {
|
||||
return nil
|
||||
}
|
||||
32
vendor/github.com/containers/storage/pkg/system/rm_freebsd.go
generated
vendored
Normal file
32
vendor/github.com/containers/storage/pkg/system/rm_freebsd.go
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"path/filepath"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func lchflags(path string, flags int) (err error) {
|
||||
p, err := unix.BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, _, e1 := unix.Syscall(unix.SYS_LCHFLAGS, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
||||
if e1 != 0 {
|
||||
return e1
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Reset file flags in a directory tree. This allows EnsureRemoveAll
|
||||
// to delete trees which have the immutable flag set.
|
||||
func resetFileFlags(dir string) error {
|
||||
return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error {
|
||||
if err := lchflags(path, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user