mirror of
https://github.com/containers/podman.git
synced 2025-10-20 04:34:01 +08:00
vendor: bump c/common to 9b0d134f392
Bump common to 9b0d134f392f41de3f3065aad162e73a3904168e Signed-off-by: flouthoc <flouthoc.git@gmail.com>
This commit is contained in:
2
vendor/github.com/containers/storage/.cirrus.yml
generated
vendored
2
vendor/github.com/containers/storage/.cirrus.yml
generated
vendored
@ -126,7 +126,7 @@ lint_task:
|
||||
folder: $GOPATH/pkg/mod
|
||||
build_script: |
|
||||
apt-get update
|
||||
apt-get install -y libbtrfs-dev
|
||||
apt-get install -y libbtrfs-dev libsubid-dev
|
||||
test_script: |
|
||||
make TAGS=regex_precompile local-validate
|
||||
make lint
|
||||
|
20
vendor/github.com/containers/storage/.golangci.yml
generated
vendored
20
vendor/github.com/containers/storage/.golangci.yml
generated
vendored
@ -1,7 +1,17 @@
|
||||
---
|
||||
run:
|
||||
concurrency: 6
|
||||
timeout: 5m
|
||||
linters:
|
||||
version: "2"
|
||||
|
||||
formatters:
|
||||
enable:
|
||||
- gofumpt
|
||||
|
||||
linters:
|
||||
exclusions:
|
||||
presets:
|
||||
- comments
|
||||
- std-error-handling
|
||||
settings:
|
||||
staticcheck:
|
||||
checks:
|
||||
- all
|
||||
- -ST1003 # https://staticcheck.dev/docs/checks/#ST1003 Poorly chosen identifier.
|
||||
- -QF1008 # https://staticcheck.dev/docs/checks/#QF1008 Omit embedded fields from selector expression.
|
||||
|
2
vendor/github.com/containers/storage/Makefile
generated
vendored
2
vendor/github.com/containers/storage/Makefile
generated
vendored
@ -35,7 +35,7 @@ TESTFLAGS := $(shell $(GO) test -race $(BUILDFLAGS) ./pkg/stringutils 2>&1 > /de
|
||||
# N/B: This value is managed by Renovate, manual changes are
|
||||
# possible, as long as they don't disturb the formatting
|
||||
# (i.e. DO NOT ADD A 'v' prefix!)
|
||||
GOLANGCI_LINT_VERSION := 1.64.8
|
||||
GOLANGCI_LINT_VERSION := 2.0.2
|
||||
|
||||
default all: local-binary docs local-validate local-cross ## validate all checks, build and cross-build\nbinaries and docs
|
||||
|
||||
|
4
vendor/github.com/containers/storage/drivers/aufs/aufs.go
generated
vendored
4
vendor/github.com/containers/storage/drivers/aufs/aufs.go
generated
vendored
@ -517,7 +517,7 @@ func (a *Driver) isParent(id, parent string) bool {
|
||||
if parent == "" && len(parents) > 0 {
|
||||
return false
|
||||
}
|
||||
return !(len(parents) > 0 && parent != parents[0])
|
||||
return len(parents) == 0 || parent == parents[0]
|
||||
}
|
||||
|
||||
// Diff produces an archive of the changes between the specified
|
||||
@ -778,6 +778,6 @@ func (a *Driver) SupportsShifting() bool {
|
||||
}
|
||||
|
||||
// Dedup performs deduplication of the driver's storage.
|
||||
func (d *Driver) Dedup(req graphdriver.DedupArgs) (graphdriver.DedupResult, error) {
|
||||
func (a *Driver) Dedup(req graphdriver.DedupArgs) (graphdriver.DedupResult, error) {
|
||||
return graphdriver.DedupResult{}, nil
|
||||
}
|
||||
|
4
vendor/github.com/containers/storage/drivers/copy/copy_linux.go
generated
vendored
4
vendor/github.com/containers/storage/drivers/copy/copy_linux.go
generated
vendored
@ -40,7 +40,7 @@ const (
|
||||
)
|
||||
|
||||
// CopyRegularToFile copies the content of a file to another
|
||||
func CopyRegularToFile(srcPath string, dstFile *os.File, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { // nolint: revive,golint
|
||||
func CopyRegularToFile(srcPath string, dstFile *os.File, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint: revive
|
||||
srcFile, err := os.Open(srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -72,7 +72,7 @@ func CopyRegularToFile(srcPath string, dstFile *os.File, fileinfo os.FileInfo, c
|
||||
}
|
||||
|
||||
// CopyRegular copies the content of a file to another
|
||||
func CopyRegular(srcPath, dstPath string, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { // nolint: revive,golint
|
||||
func CopyRegular(srcPath, dstPath string, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint: revive
|
||||
// If the destination file already exists, we shouldn't blow it away
|
||||
dstFile, err := os.OpenFile(dstPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, fileinfo.Mode())
|
||||
if err != nil {
|
||||
|
4
vendor/github.com/containers/storage/drivers/copy/copy_unsupported.go
generated
vendored
4
vendor/github.com/containers/storage/drivers/copy/copy_unsupported.go
generated
vendored
@ -24,7 +24,7 @@ func DirCopy(srcDir, dstDir string, _ Mode, _ bool) error {
|
||||
}
|
||||
|
||||
// CopyRegularToFile copies the content of a file to another
|
||||
func CopyRegularToFile(srcPath string, dstFile *os.File, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint: revive,golint // "func name will be used as copy.CopyRegularToFile by other packages, and that stutters"
|
||||
func CopyRegularToFile(srcPath string, dstFile *os.File, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint: revive // "func name will be used as copy.CopyRegularToFile by other packages, and that stutters"
|
||||
f, err := os.Open(srcPath)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -35,6 +35,6 @@ func CopyRegularToFile(srcPath string, dstFile *os.File, fileinfo os.FileInfo, c
|
||||
}
|
||||
|
||||
// CopyRegular copies the content of a file to another
|
||||
func CopyRegular(srcPath, dstPath string, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint:revive,golint // "func name will be used as copy.CopyRegular by other packages, and that stutters"
|
||||
func CopyRegular(srcPath, dstPath string, fileinfo os.FileInfo, copyWithFileRange, copyWithFileClone *bool) error { //nolint:revive // "func name will be used as copy.CopyRegular by other packages, and that stutters"
|
||||
return chrootarchive.NewArchiver(nil).CopyWithTar(srcPath, dstPath)
|
||||
}
|
||||
|
4
vendor/github.com/containers/storage/drivers/driver.go
generated
vendored
4
vendor/github.com/containers/storage/drivers/driver.go
generated
vendored
@ -54,8 +54,8 @@ type MountOpts struct {
|
||||
// Mount label is the MAC Labels to assign to mount point (SELINUX)
|
||||
MountLabel string
|
||||
// UidMaps & GidMaps are the User Namespace mappings to be assigned to content in the mount point
|
||||
UidMaps []idtools.IDMap //nolint: revive,golint
|
||||
GidMaps []idtools.IDMap //nolint: revive,golint
|
||||
UidMaps []idtools.IDMap //nolint: revive
|
||||
GidMaps []idtools.IDMap //nolint: revive
|
||||
Options []string
|
||||
|
||||
// Volatile specifies whether the container storage can be optimized
|
||||
|
4
vendor/github.com/containers/storage/drivers/overlay/composefs.go
generated
vendored
4
vendor/github.com/containers/storage/drivers/overlay/composefs.go
generated
vendored
@ -53,7 +53,7 @@ func generateComposeFsBlob(verityDigests map[string]string, toc interface{}, com
|
||||
}
|
||||
|
||||
destFile := getComposefsBlob(composefsDir)
|
||||
writerJson, err := getComposeFsHelper()
|
||||
writerJSON, err := getComposeFsHelper()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to find mkcomposefs: %w", err)
|
||||
}
|
||||
@ -74,7 +74,7 @@ func generateComposeFsBlob(verityDigests map[string]string, toc interface{}, com
|
||||
defer outFile.Close()
|
||||
|
||||
errBuf := &bytes.Buffer{}
|
||||
cmd := exec.Command(writerJson, "--from-file", "-", "-")
|
||||
cmd := exec.Command(writerJSON, "--from-file", "-", "-")
|
||||
cmd.Stderr = errBuf
|
||||
cmd.Stdin = dumpReader
|
||||
cmd.Stdout = outFile
|
||||
|
41
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
41
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
@ -130,6 +130,9 @@ type Driver struct {
|
||||
usingMetacopy bool
|
||||
usingComposefs bool
|
||||
|
||||
stagingDirsLocksMutex sync.Mutex
|
||||
// stagingDirsLocks access is not thread safe, it is required that callers take
|
||||
// stagingDirsLocksMutex on each access to guard against concurrent map writes.
|
||||
stagingDirsLocks map[string]*lockfile.LockFile
|
||||
|
||||
supportsIDMappedMounts *bool
|
||||
@ -428,17 +431,18 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
|
||||
}
|
||||
|
||||
d := &Driver{
|
||||
name: "overlay",
|
||||
home: home,
|
||||
imageStore: options.ImageStore,
|
||||
runhome: runhome,
|
||||
ctr: graphdriver.NewRefCounter(graphdriver.NewFsChecker(fileSystemType)),
|
||||
supportsDType: supportsDType,
|
||||
usingMetacopy: usingMetacopy,
|
||||
supportsVolatile: supportsVolatile,
|
||||
usingComposefs: opts.useComposefs,
|
||||
options: *opts,
|
||||
stagingDirsLocks: make(map[string]*lockfile.LockFile),
|
||||
name: "overlay",
|
||||
home: home,
|
||||
imageStore: options.ImageStore,
|
||||
runhome: runhome,
|
||||
ctr: graphdriver.NewRefCounter(graphdriver.NewFsChecker(fileSystemType)),
|
||||
supportsDType: supportsDType,
|
||||
usingMetacopy: usingMetacopy,
|
||||
supportsVolatile: supportsVolatile,
|
||||
usingComposefs: opts.useComposefs,
|
||||
options: *opts,
|
||||
stagingDirsLocksMutex: sync.Mutex{},
|
||||
stagingDirsLocks: make(map[string]*lockfile.LockFile),
|
||||
}
|
||||
|
||||
d.naiveDiff = graphdriver.NewNaiveDiffDriver(d, graphdriver.NewNaiveLayerIDMapUpdater(d))
|
||||
@ -639,6 +643,8 @@ func SupportsNativeOverlay(home, runhome string) (bool, error) {
|
||||
case "true":
|
||||
logrus.Debugf("overlay: storage already configured with a mount-program")
|
||||
return false, nil
|
||||
case "false":
|
||||
// Do nothing.
|
||||
default:
|
||||
needsMountProgram, err := scanForMountProgramIndicators(home)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
@ -652,7 +658,6 @@ func SupportsNativeOverlay(home, runhome string) (bool, error) {
|
||||
}
|
||||
// fall through to check if we find ourselves needing to use a
|
||||
// mount program now
|
||||
case "false":
|
||||
}
|
||||
|
||||
for _, dir := range []string{home, runhome} {
|
||||
@ -867,10 +872,12 @@ func (d *Driver) Cleanup() error {
|
||||
// pruneStagingDirectories cleans up any staging directory that was leaked.
|
||||
// It returns whether any staging directory is still present.
|
||||
func (d *Driver) pruneStagingDirectories() bool {
|
||||
d.stagingDirsLocksMutex.Lock()
|
||||
for _, lock := range d.stagingDirsLocks {
|
||||
lock.Unlock()
|
||||
}
|
||||
d.stagingDirsLocks = make(map[string]*lockfile.LockFile)
|
||||
clear(d.stagingDirsLocks)
|
||||
d.stagingDirsLocksMutex.Unlock()
|
||||
|
||||
anyPresent := false
|
||||
|
||||
@ -2168,10 +2175,12 @@ func (d *Driver) DiffGetter(id string) (_ graphdriver.FileGetCloser, Err error)
|
||||
func (d *Driver) CleanupStagingDirectory(stagingDirectory string) error {
|
||||
parentStagingDir := filepath.Dir(stagingDirectory)
|
||||
|
||||
d.stagingDirsLocksMutex.Lock()
|
||||
if lock, ok := d.stagingDirsLocks[parentStagingDir]; ok {
|
||||
delete(d.stagingDirsLocks, parentStagingDir)
|
||||
lock.Unlock()
|
||||
}
|
||||
d.stagingDirsLocksMutex.Unlock()
|
||||
|
||||
return os.RemoveAll(parentStagingDir)
|
||||
}
|
||||
@ -2230,11 +2239,15 @@ func (d *Driver) ApplyDiffWithDiffer(options *graphdriver.ApplyDiffWithDifferOpt
|
||||
}
|
||||
defer func() {
|
||||
if errRet != nil {
|
||||
d.stagingDirsLocksMutex.Lock()
|
||||
delete(d.stagingDirsLocks, layerDir)
|
||||
d.stagingDirsLocksMutex.Unlock()
|
||||
lock.Unlock()
|
||||
}
|
||||
}()
|
||||
d.stagingDirsLocksMutex.Lock()
|
||||
d.stagingDirsLocks[layerDir] = lock
|
||||
d.stagingDirsLocksMutex.Unlock()
|
||||
lock.Lock()
|
||||
|
||||
logrus.Debugf("Applying differ in %s", applyDir)
|
||||
@ -2266,10 +2279,12 @@ func (d *Driver) ApplyDiffFromStagingDirectory(id, parent string, diffOutput *gr
|
||||
parentStagingDir := filepath.Dir(stagingDirectory)
|
||||
|
||||
defer func() {
|
||||
d.stagingDirsLocksMutex.Lock()
|
||||
if lock, ok := d.stagingDirsLocks[parentStagingDir]; ok {
|
||||
delete(d.stagingDirsLocks, parentStagingDir)
|
||||
lock.Unlock()
|
||||
}
|
||||
d.stagingDirsLocksMutex.Unlock()
|
||||
}()
|
||||
|
||||
diffPath, err := d.getDiffPath(id)
|
||||
|
6
vendor/github.com/containers/storage/internal/dedup/dedup.go
generated
vendored
6
vendor/github.com/containers/storage/internal/dedup/dedup.go
generated
vendored
@ -13,7 +13,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var notSupported = errors.New("reflinks are not supported on this platform")
|
||||
var errNotSupported = errors.New("reflinks are not supported on this platform")
|
||||
|
||||
const (
|
||||
DedupHashInvalid DedupHashMethod = iota
|
||||
@ -134,7 +134,7 @@ func DedupDirs(dirs []string, options DedupOptions) (DedupResult, error) {
|
||||
break
|
||||
}
|
||||
logrus.Debugf("Failed to deduplicate: %v", err)
|
||||
if errors.Is(err, notSupported) {
|
||||
if errors.Is(err, errNotSupported) {
|
||||
return dedupBytes, err
|
||||
}
|
||||
}
|
||||
@ -153,7 +153,7 @@ func DedupDirs(dirs []string, options DedupOptions) (DedupResult, error) {
|
||||
return nil
|
||||
}); err != nil {
|
||||
// if reflinks are not supported, return immediately without errors
|
||||
if errors.Is(err, notSupported) {
|
||||
if errors.Is(err, errNotSupported) {
|
||||
return res, nil
|
||||
}
|
||||
return res, err
|
||||
|
2
vendor/github.com/containers/storage/internal/dedup/dedup_linux.go
generated
vendored
2
vendor/github.com/containers/storage/internal/dedup/dedup_linux.go
generated
vendored
@ -98,7 +98,7 @@ func (d *dedupFiles) dedup(src, dst string, fiDst fs.FileInfo) (uint64, error) {
|
||||
}
|
||||
|
||||
if errors.Is(err, unix.ENOTSUP) {
|
||||
return 0, notSupported
|
||||
return 0, errNotSupported
|
||||
}
|
||||
return 0, fmt.Errorf("failed to clone file %q: %w", src, err)
|
||||
}
|
||||
|
8
vendor/github.com/containers/storage/internal/dedup/dedup_unsupported.go
generated
vendored
8
vendor/github.com/containers/storage/internal/dedup/dedup_unsupported.go
generated
vendored
@ -9,19 +9,19 @@ import (
|
||||
type dedupFiles struct{}
|
||||
|
||||
func newDedupFiles() (*dedupFiles, error) {
|
||||
return nil, notSupported
|
||||
return nil, errNotSupported
|
||||
}
|
||||
|
||||
// isFirstVisitOf records that the file is being processed. Returns true if the file was already visited.
|
||||
func (d *dedupFiles) isFirstVisitOf(fi fs.FileInfo) (bool, error) {
|
||||
return false, notSupported
|
||||
return false, errNotSupported
|
||||
}
|
||||
|
||||
// dedup deduplicates the file at src path to dst path
|
||||
func (d *dedupFiles) dedup(src, dst string, fiDst fs.FileInfo) (uint64, error) {
|
||||
return 0, notSupported
|
||||
return 0, errNotSupported
|
||||
}
|
||||
|
||||
func readAllFile(path string, info fs.FileInfo, fn func([]byte) (string, error)) (string, error) {
|
||||
return "", notSupported
|
||||
return "", errNotSupported
|
||||
}
|
||||
|
4
vendor/github.com/containers/storage/pkg/archive/archive.go
generated
vendored
4
vendor/github.com/containers/storage/pkg/archive/archive.go
generated
vendored
@ -687,7 +687,7 @@ func extractTarFileEntry(path, extractDir string, hdr *tar.Header, reader io.Rea
|
||||
case tar.TypeDir:
|
||||
// Create directory unless it exists as a directory already.
|
||||
// In that case we just want to merge the two
|
||||
if fi, err := os.Lstat(path); !(err == nil && fi.IsDir()) {
|
||||
if fi, err := os.Lstat(path); err != nil || !fi.IsDir() {
|
||||
if err := os.Mkdir(path, mask); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -1130,7 +1130,7 @@ loop:
|
||||
continue
|
||||
}
|
||||
|
||||
if !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) {
|
||||
if !fi.IsDir() || hdr.Typeflag != tar.TypeDir {
|
||||
if err := os.RemoveAll(path); err != nil {
|
||||
return err
|
||||
}
|
||||
|
2
vendor/github.com/containers/storage/pkg/archive/changes.go
generated
vendored
2
vendor/github.com/containers/storage/pkg/archive/changes.go
generated
vendored
@ -70,7 +70,7 @@ func (c changesByPath) Swap(i, j int) { c[j], c[i] = c[i], c[j] }
|
||||
// files, we handle this by comparing for exact times, *or* same
|
||||
// second count and either a or b having exactly 0 nanoseconds
|
||||
func sameFsTime(a, b time.Time) bool {
|
||||
return a == b ||
|
||||
return a.Equal(b) ||
|
||||
(a.Unix() == b.Unix() &&
|
||||
(a.Nanosecond() == 0 || b.Nanosecond() == 0))
|
||||
}
|
||||
|
9
vendor/github.com/containers/storage/pkg/archive/changes_linux.go
generated
vendored
9
vendor/github.com/containers/storage/pkg/archive/changes_linux.go
generated
vendored
@ -174,14 +174,7 @@ func (w *walker) walk(path string, i1, i2 os.FileInfo) (err error) {
|
||||
ix1 := 0
|
||||
ix2 := 0
|
||||
|
||||
for {
|
||||
if ix1 >= len(names1) {
|
||||
break
|
||||
}
|
||||
if ix2 >= len(names2) {
|
||||
break
|
||||
}
|
||||
|
||||
for ix1 < len(names1) && ix2 < len(names2) {
|
||||
ni1 := names1[ix1]
|
||||
ni2 := names2[ix2]
|
||||
|
||||
|
2
vendor/github.com/containers/storage/pkg/archive/diff.go
generated
vendored
2
vendor/github.com/containers/storage/pkg/archive/diff.go
generated
vendored
@ -178,7 +178,7 @@ func UnpackLayer(dest string, layer io.Reader, options *TarOptions) (size int64,
|
||||
if err := resetImmutable(path, &fi); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) {
|
||||
if !fi.IsDir() || hdr.Typeflag != tar.TypeDir {
|
||||
if err := os.RemoveAll(path); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
4
vendor/github.com/containers/storage/pkg/chunked/compression_linux.go
generated
vendored
4
vendor/github.com/containers/storage/pkg/chunked/compression_linux.go
generated
vendored
@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"slices"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@ -17,7 +18,6 @@ import (
|
||||
"github.com/vbatts/tar-split/archive/tar"
|
||||
"github.com/vbatts/tar-split/tar/asm"
|
||||
"github.com/vbatts/tar-split/tar/storage"
|
||||
expMaps "golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -310,7 +310,7 @@ func ensureTOCMatchesTarSplit(toc *minimal.TOC, tarSplit []byte) error {
|
||||
return err
|
||||
}
|
||||
if len(pendingFiles) != 0 {
|
||||
remaining := expMaps.Keys(pendingFiles)
|
||||
remaining := slices.Collect(maps.Keys(pendingFiles))
|
||||
if len(remaining) > 5 {
|
||||
remaining = remaining[:5] // Just to limit the size of the output.
|
||||
}
|
||||
|
5
vendor/github.com/containers/storage/pkg/chunked/compressor/compressor.go
generated
vendored
5
vendor/github.com/containers/storage/pkg/chunked/compressor/compressor.go
generated
vendored
@ -142,10 +142,7 @@ func (rc *rollingChecksumReader) Read(b []byte) (bool, int, error) {
|
||||
rc.IsLastChunkZeros = false
|
||||
|
||||
if rc.pendingHole > 0 {
|
||||
toCopy := int64(len(b))
|
||||
if rc.pendingHole < toCopy {
|
||||
toCopy = rc.pendingHole
|
||||
}
|
||||
toCopy := min(rc.pendingHole, int64(len(b)))
|
||||
rc.pendingHole -= toCopy
|
||||
for i := int64(0); i < toCopy; i++ {
|
||||
b[i] = 0
|
||||
|
12
vendor/github.com/containers/storage/pkg/chunked/storage_linux.go
generated
vendored
12
vendor/github.com/containers/storage/pkg/chunked/storage_linux.go
generated
vendored
@ -698,18 +698,12 @@ func (c *chunkedDiffer) prepareCompressedStreamToFile(partCompression compressed
|
||||
|
||||
// hashHole writes SIZE zeros to the specified hasher
|
||||
func hashHole(h hash.Hash, size int64, copyBuffer []byte) error {
|
||||
count := int64(len(copyBuffer))
|
||||
if size < count {
|
||||
count = size
|
||||
}
|
||||
count := min(size, int64(len(copyBuffer)))
|
||||
for i := int64(0); i < count; i++ {
|
||||
copyBuffer[i] = 0
|
||||
}
|
||||
for size > 0 {
|
||||
count = int64(len(copyBuffer))
|
||||
if size < count {
|
||||
count = size
|
||||
}
|
||||
count = min(size, int64(len(copyBuffer)))
|
||||
if _, err := h.Write(copyBuffer[:count]); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -1271,7 +1265,7 @@ func getBlobAtConverterGoroutine(stream chan streamOrErr, streams chan io.ReadCl
|
||||
tooManyStreams := false
|
||||
streamsSoFar := 0
|
||||
|
||||
err := errors.New("Unexpected error in getBlobAtGoroutine")
|
||||
err := errors.New("unexpected error in getBlobAtGoroutine")
|
||||
|
||||
defer func() {
|
||||
if err != nil {
|
||||
|
2
vendor/github.com/containers/storage/pkg/idmap/idmapped_utils.go
generated
vendored
2
vendor/github.com/containers/storage/pkg/idmap/idmapped_utils.go
generated
vendored
@ -25,7 +25,7 @@ func CreateIDMappedMount(source, target string, pid int) error {
|
||||
}
|
||||
defer userNsFile.Close()
|
||||
|
||||
targetDirFd, err := unix.OpenTree(0, source, unix.OPEN_TREE_CLONE)
|
||||
targetDirFd, err := unix.OpenTree(unix.AT_FDCWD, source, unix.OPEN_TREE_CLONE)
|
||||
if err != nil {
|
||||
return &os.PathError{Op: "open_tree", Path: source, Err: err}
|
||||
}
|
||||
|
18
vendor/github.com/containers/storage/pkg/idtools/idtools.go
generated
vendored
18
vendor/github.com/containers/storage/pkg/idtools/idtools.go
generated
vendored
@ -429,25 +429,25 @@ func parseOverrideXattr(xstat []byte) (Stat, error) {
|
||||
var stat Stat
|
||||
attrs := strings.Split(string(xstat), ":")
|
||||
if len(attrs) < 3 {
|
||||
return stat, fmt.Errorf("The number of parts in %s is less than 3",
|
||||
return stat, fmt.Errorf("the number of parts in %s is less than 3",
|
||||
ContainersOverrideXattr)
|
||||
}
|
||||
|
||||
value, err := strconv.ParseUint(attrs[0], 10, 32)
|
||||
if err != nil {
|
||||
return stat, fmt.Errorf("Failed to parse UID: %w", err)
|
||||
return stat, fmt.Errorf("failed to parse UID: %w", err)
|
||||
}
|
||||
stat.IDs.UID = int(value)
|
||||
|
||||
value, err = strconv.ParseUint(attrs[1], 10, 32)
|
||||
if err != nil {
|
||||
return stat, fmt.Errorf("Failed to parse GID: %w", err)
|
||||
return stat, fmt.Errorf("failed to parse GID: %w", err)
|
||||
}
|
||||
stat.IDs.GID = int(value)
|
||||
|
||||
value, err = strconv.ParseUint(attrs[2], 8, 32)
|
||||
if err != nil {
|
||||
return stat, fmt.Errorf("Failed to parse mode: %w", err)
|
||||
return stat, fmt.Errorf("failed to parse mode: %w", err)
|
||||
}
|
||||
stat.Mode = os.FileMode(value) & os.ModePerm
|
||||
if value&0o1000 != 0 {
|
||||
@ -484,7 +484,7 @@ func parseOverrideXattr(xstat []byte) (Stat, error) {
|
||||
return stat, err
|
||||
}
|
||||
} else {
|
||||
return stat, fmt.Errorf("Invalid file type %s", typ)
|
||||
return stat, fmt.Errorf("invalid file type %s", typ)
|
||||
}
|
||||
}
|
||||
return stat, nil
|
||||
@ -494,18 +494,18 @@ func parseDevice(typ string) (int, int, error) {
|
||||
parts := strings.Split(typ, "-")
|
||||
// If there are more than 3 parts, just ignore them to be forward compatible
|
||||
if len(parts) < 3 {
|
||||
return 0, 0, fmt.Errorf("Invalid device type %s", typ)
|
||||
return 0, 0, fmt.Errorf("invalid device type %s", typ)
|
||||
}
|
||||
if parts[0] != "block" && parts[0] != "char" {
|
||||
return 0, 0, fmt.Errorf("Invalid device type %s", typ)
|
||||
return 0, 0, fmt.Errorf("invalid device type %s", typ)
|
||||
}
|
||||
major, err := strconv.Atoi(parts[1])
|
||||
if err != nil {
|
||||
return 0, 0, fmt.Errorf("Failed to parse major number: %w", err)
|
||||
return 0, 0, fmt.Errorf("failed to parse major number: %w", err)
|
||||
}
|
||||
minor, err := strconv.Atoi(parts[2])
|
||||
if err != nil {
|
||||
return 0, 0, fmt.Errorf("Failed to parse minor number: %w", err)
|
||||
return 0, 0, fmt.Errorf("failed to parse minor number: %w", err)
|
||||
}
|
||||
return major, minor, nil
|
||||
}
|
||||
|
4
vendor/github.com/containers/storage/pkg/idtools/idtools_supported.go
generated
vendored
4
vendor/github.com/containers/storage/pkg/idtools/idtools_supported.go
generated
vendored
@ -29,9 +29,7 @@ struct subid_range get_range(struct subid_range *ranges, int i)
|
||||
*/
|
||||
import "C"
|
||||
|
||||
var (
|
||||
onceInit sync.Once
|
||||
)
|
||||
var onceInit sync.Once
|
||||
|
||||
func readSubid(username string, isUser bool) (ranges, error) {
|
||||
var ret ranges
|
||||
|
5
vendor/github.com/containers/storage/pkg/ioutils/bytespipe.go
generated
vendored
5
vendor/github.com/containers/storage/pkg/ioutils/bytespipe.go
generated
vendored
@ -93,10 +93,7 @@ loop0:
|
||||
}
|
||||
|
||||
// add new byte slice to the buffers slice and continue writing
|
||||
nextCap := b.Cap() * 2
|
||||
if nextCap > maxCap {
|
||||
nextCap = maxCap
|
||||
}
|
||||
nextCap := min(b.Cap()*2, maxCap)
|
||||
bp.buf = append(bp.buf, getBuffer(nextCap))
|
||||
}
|
||||
bp.wait.Broadcast()
|
||||
|
4
vendor/github.com/containers/storage/pkg/loopback/attach_loopback.go
generated
vendored
4
vendor/github.com/containers/storage/pkg/loopback/attach_loopback.go
generated
vendored
@ -16,8 +16,8 @@ import (
|
||||
// Loopback related errors
|
||||
var (
|
||||
ErrAttachLoopbackDevice = errors.New("loopback attach failed")
|
||||
ErrGetLoopbackBackingFile = errors.New("Unable to get loopback backing file")
|
||||
ErrSetCapacity = errors.New("Unable set loopback capacity")
|
||||
ErrGetLoopbackBackingFile = errors.New("unable to get loopback backing file")
|
||||
ErrSetCapacity = errors.New("unable set loopback capacity")
|
||||
)
|
||||
|
||||
func stringToLoopName(src string) [LoNameSize]uint8 {
|
||||
|
12
vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go
generated
vendored
12
vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go
generated
vendored
@ -32,9 +32,9 @@ type Cmd struct {
|
||||
*exec.Cmd
|
||||
UnshareFlags int
|
||||
UseNewuidmap bool
|
||||
UidMappings []specs.LinuxIDMapping // nolint: revive,golint
|
||||
UidMappings []specs.LinuxIDMapping //nolint: revive
|
||||
UseNewgidmap bool
|
||||
GidMappings []specs.LinuxIDMapping // nolint: revive,golint
|
||||
GidMappings []specs.LinuxIDMapping //nolint: revive
|
||||
GidMappingsEnableSetgroups bool
|
||||
Setsid bool
|
||||
Setpgrp bool
|
||||
@ -249,7 +249,7 @@ func (c *Cmd) Start() (retErr error) {
|
||||
if err != nil {
|
||||
return fmt.Errorf("finding newgidmap: %w", err)
|
||||
}
|
||||
cmd := exec.Command(path, append([]string{pidString}, strings.Fields(strings.Replace(g.String(), "\n", " ", -1))...)...)
|
||||
cmd := exec.Command(path, append([]string{pidString}, strings.Fields(g.String())...)...)
|
||||
g.Reset()
|
||||
cmd.Stdout = g
|
||||
cmd.Stderr = g
|
||||
@ -267,7 +267,7 @@ func (c *Cmd) Start() (retErr error) {
|
||||
}
|
||||
logrus.Warnf("Falling back to single mapping")
|
||||
g.Reset()
|
||||
g.Write([]byte(fmt.Sprintf("0 %d 1\n", os.Getegid())))
|
||||
fmt.Fprintf(g, "0 %d 1\n", os.Getegid())
|
||||
}
|
||||
}
|
||||
if !gidmapSet {
|
||||
@ -309,7 +309,7 @@ func (c *Cmd) Start() (retErr error) {
|
||||
if err != nil {
|
||||
return fmt.Errorf("finding newuidmap: %w", err)
|
||||
}
|
||||
cmd := exec.Command(path, append([]string{pidString}, strings.Fields(strings.Replace(u.String(), "\n", " ", -1))...)...)
|
||||
cmd := exec.Command(path, append([]string{pidString}, strings.Fields(u.String())...)...)
|
||||
u.Reset()
|
||||
cmd.Stdout = u
|
||||
cmd.Stderr = u
|
||||
@ -328,7 +328,7 @@ func (c *Cmd) Start() (retErr error) {
|
||||
|
||||
logrus.Warnf("Falling back to single mapping")
|
||||
u.Reset()
|
||||
u.Write([]byte(fmt.Sprintf("0 %d 1\n", os.Geteuid())))
|
||||
fmt.Fprintf(u, "0 %d 1\n", os.Geteuid())
|
||||
}
|
||||
}
|
||||
if !uidmapSet {
|
||||
|
2
vendor/github.com/containers/storage/store.go
generated
vendored
2
vendor/github.com/containers/storage/store.go
generated
vendored
@ -3723,7 +3723,7 @@ func makeBigDataBaseName(key string) string {
|
||||
if err != nil || size != 1 {
|
||||
break
|
||||
}
|
||||
if ch != '.' && !(ch >= '0' && ch <= '9') && !(ch >= 'a' && ch <= 'z') {
|
||||
if ch != '.' && (ch < '0' || ch > '9') && (ch < 'a' || ch > 'z') {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
2
vendor/github.com/containers/storage/types/options.go
generated
vendored
2
vendor/github.com/containers/storage/types/options.go
generated
vendored
@ -394,7 +394,7 @@ func ReloadConfigurationFileIfNeeded(configFile string, storeOptions *StoreOptio
|
||||
}
|
||||
|
||||
mtime := fi.ModTime()
|
||||
if prevReloadConfig.storeOptions != nil && prevReloadConfig.mod == mtime && prevReloadConfig.configFile == configFile {
|
||||
if prevReloadConfig.storeOptions != nil && mtime.Equal(prevReloadConfig.mod) && prevReloadConfig.configFile == configFile {
|
||||
*storeOptions = *prevReloadConfig.storeOptions
|
||||
return nil
|
||||
}
|
||||
|
4
vendor/github.com/containers/storage/types/utils.go
generated
vendored
4
vendor/github.com/containers/storage/types/utils.go
generated
vendored
@ -14,7 +14,7 @@ import (
|
||||
|
||||
func expandEnvPath(path string, rootlessUID int) (string, error) {
|
||||
var err error
|
||||
path = strings.Replace(path, "$UID", strconv.Itoa(rootlessUID), -1)
|
||||
path = strings.ReplaceAll(path, "$UID", strconv.Itoa(rootlessUID))
|
||||
path = os.ExpandEnv(path)
|
||||
newpath, err := filepath.EvalSymlinks(path)
|
||||
if err != nil {
|
||||
@ -61,7 +61,7 @@ func reloadConfigurationFileIfNeeded(configFile string, storeOptions *StoreOptio
|
||||
}
|
||||
|
||||
mtime := fi.ModTime()
|
||||
if prevReloadConfig.storeOptions != nil && prevReloadConfig.mod == mtime && prevReloadConfig.configFile == configFile {
|
||||
if prevReloadConfig.storeOptions != nil && mtime.Equal(prevReloadConfig.mod) && prevReloadConfig.configFile == configFile {
|
||||
*storeOptions = *prevReloadConfig.storeOptions
|
||||
return
|
||||
}
|
||||
|
5
vendor/github.com/containers/storage/userns.go
generated
vendored
5
vendor/github.com/containers/storage/userns.go
generated
vendored
@ -276,10 +276,7 @@ func (s *store) getAutoUserNS(options *types.AutoUserNsOptions, image *Image, rl
|
||||
// bigger than s.autoNsMaxSize.
|
||||
// This is a best effort heuristic.
|
||||
if requestedSize == 0 {
|
||||
size = initialSize
|
||||
if s.autoNsMinSize > size {
|
||||
size = s.autoNsMinSize
|
||||
}
|
||||
size = max(s.autoNsMinSize, initialSize)
|
||||
if image != nil {
|
||||
sizeFromImage, err := s.getMaxSizeFromImage(image, rlstore, lstores, options.PasswdFile, options.GroupFile)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user