fix(deps): update module github.com/containers/common to v0.53.0

Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
renovate[bot] 2023-04-27 08:11:37 +00:00 committed by GitHub
parent a5b3e41f4c
commit 5e43f8c9dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 101 additions and 25 deletions

4
go.mod
View File

@ -5,13 +5,13 @@ go 1.18
require (
github.com/containerd/containerd v1.7.0
github.com/containernetworking/cni v1.1.2
github.com/containers/common v0.52.0
github.com/containers/common v0.53.0
github.com/containers/image/v5 v5.25.0
github.com/containers/ocicrypt v1.1.7
github.com/containers/storage v1.46.1
github.com/cyphar/filepath-securejoin v0.2.3
github.com/docker/distribution v2.8.1+incompatible
github.com/docker/docker v23.0.3+incompatible
github.com/docker/docker v23.0.4+incompatible
github.com/docker/go-units v0.5.0
github.com/fsouza/go-dockerclient v1.9.7
github.com/ghodss/yaml v1.0.0

8
go.sum
View File

@ -48,8 +48,8 @@ github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl3
github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw=
github.com/containernetworking/plugins v1.2.0 h1:SWgg3dQG1yzUo4d9iD8cwSVh1VqI+bP7mkPDoSfP9VU=
github.com/containernetworking/plugins v1.2.0/go.mod h1:/VjX4uHecW5vVimFa1wkG4s+r/s9qIfPdqlLF4TW8c4=
github.com/containers/common v0.52.0 h1:S5GApgpNEGBuPhDHTFgMc55y5gsuxHcQeElvUpO5kp4=
github.com/containers/common v0.52.0/go.mod h1:dNJJVNBu1wJtAH+vFIMXV+fQHBdEVNmNP3ImjbKper4=
github.com/containers/common v0.53.0 h1:Ax814cLeX5VXSnkKUdxz762g+27fJj1st4UvKoXmkKs=
github.com/containers/common v0.53.0/go.mod h1:pABPxJwlTE8oYk9/2BW0e0mumkuhJHIPsABHTGRXN3w=
github.com/containers/image/v5 v5.25.0 h1:TJ0unmalbU+scd0i3Txap2wjGsAnv06MSCwgn6bsizk=
github.com/containers/image/v5 v5.25.0/go.mod h1:EKvys0WVlRFkDw26R8y52TuhV9Tfn0yq2luLX6W52Ls=
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA=
@ -72,8 +72,8 @@ github.com/disiqueira/gotree/v3 v3.0.2 h1:ik5iuLQQoufZBNPY518dXhiO5056hyNBIK9lWh
github.com/disiqueira/gotree/v3 v3.0.2/go.mod h1:ZuyjE4+mUQZlbpkI24AmruZKhg3VHEgPLDY8Qk+uUu8=
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho=
github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v23.0.4+incompatible h1:Kd3Bh9V/rO+XpTP/BLqM+gx8z7+Yb0AA2Ibj+nNo4ek=
github.com/docker/docker v23.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 h1:IPrmumsT9t5BS7XcPhgsCTlkWbYg80SEXUzDpReaU6Y=

View File

@ -242,14 +242,19 @@ func replaceURLByHostPort(repository string) (string, error) {
// using the -u and -p flags. If the username prompt is left empty, the
// displayed userFromAuthFile will be used instead.
func getUserAndPass(opts *LoginOptions, password, userFromAuthFile string) (user, pass string, err error) {
reader := bufio.NewReader(opts.Stdin)
username := opts.Username
if username == "" {
if opts.Stdin == nil {
return "", "", fmt.Errorf("cannot prompt for username without stdin")
}
if userFromAuthFile != "" {
fmt.Fprintf(opts.Stdout, "Username (%s): ", userFromAuthFile)
} else {
fmt.Fprint(opts.Stdout, "Username: ")
}
reader := bufio.NewReader(opts.Stdin)
username, err = reader.ReadString('\n')
if err != nil {
return "", "", fmt.Errorf("reading username: %w", err)

View File

@ -392,6 +392,11 @@ default_sysctls = [
# short-name aliases defined in containers-registries.conf(5).
#compat_api_enforce_docker_hub = true
# The database backend of Podman. Supported values are "boltdb" (default) and
# "sqlite". Please run `podman-system-reset` prior to changing the database
# backend of an existing deployment, to make sure Podman can operate correctly.
#database_backend="boltdb"
# Specify the keys sequence used to detach a container.
# Format is a single character [a-Z] or a comma separated sequence of
# `ctrl-<value>`, where `<value>` is one of:

View File

@ -29,6 +29,11 @@
#
#base_hosts_file = ""
# The database backend of Podman. Supported values are "boltdb" (default) and
# "sqlite". Please run `podman-system-reset` prior to changing the database
# backend of an existing deployment, to make sure Podman can operate correctly.
#database_backend="boltdb"
# List of default capabilities for containers. If it is empty or commented out,
# the default capabilities defined in the container engine will be added.
#

View File

@ -27,9 +27,10 @@ var (
UserOverrideMountsFile = filepath.Join(os.Getenv("HOME"), ".config/containers/mounts.conf")
)
// subscriptionData stores the name of the file and the content read from it
// subscriptionData stores the relative name of the file and the content read from it
type subscriptionData struct {
name string
// relPath is the relative path to the file
relPath string
data []byte
mode os.FileMode
dirMode os.FileMode
@ -37,11 +38,16 @@ type subscriptionData struct {
// saveTo saves subscription data to given directory
func (s subscriptionData) saveTo(dir string) error {
path := filepath.Join(dir, s.name)
if err := os.MkdirAll(filepath.Dir(path), s.dirMode); err != nil {
return err
// We need to join the path here and create all parent directories, only
// creating dir is not good enough as relPath could also contain directories.
path := filepath.Join(dir, s.relPath)
if err := umask.MkdirAllIgnoreUmask(filepath.Dir(path), s.dirMode); err != nil {
return fmt.Errorf("create subscription directory: %w", err)
}
return os.WriteFile(path, s.data, s.mode)
if err := umask.WriteFileIgnoreUmask(path, s.data, s.mode); err != nil {
return fmt.Errorf("write subscription data: %w", err)
}
return nil
}
func readAll(root, prefix string, parentMode os.FileMode) ([]subscriptionData, error) {
@ -94,7 +100,7 @@ func readFileOrDir(root, name string, parentMode os.FileMode) ([]subscriptionDat
return nil, err
}
return []subscriptionData{{
name: name,
relPath: name,
data: bytes,
mode: s.Mode(),
dirMode: parentMode,
@ -242,13 +248,9 @@ func addSubscriptionsFromMountsFile(filePath, mountLabel, containerRunDir string
return nil, err
}
// Don't let the umask have any influence on the file and directory creation
oldUmask := umask.Set(0)
defer umask.Set(oldUmask)
switch mode := fileInfo.Mode(); {
case mode.IsDir():
if err = os.MkdirAll(ctrDirOrFileOnHost, mode.Perm()); err != nil {
if err = umask.MkdirAllIgnoreUmask(ctrDirOrFileOnHost, mode.Perm()); err != nil {
return nil, fmt.Errorf("making container directory: %w", err)
}
data, err := getHostSubscriptionData(hostDirOrFile, mode.Perm())
@ -266,10 +268,11 @@ func addSubscriptionsFromMountsFile(filePath, mountLabel, containerRunDir string
return nil, err
}
for _, s := range data {
if err := os.MkdirAll(filepath.Dir(ctrDirOrFileOnHost), s.dirMode); err != nil {
return nil, err
dir := filepath.Dir(ctrDirOrFileOnHost)
if err := umask.MkdirAllIgnoreUmask(dir, s.dirMode); err != nil {
return nil, fmt.Errorf("create container dir: %w", err)
}
if err := os.WriteFile(ctrDirOrFileOnHost, s.data, s.mode); err != nil {
if err := umask.WriteFileIgnoreUmask(ctrDirOrFileOnHost, s.data, s.mode); err != nil {
return nil, fmt.Errorf("saving data to container filesystem: %w", err)
}
}

58
vendor/github.com/containers/common/pkg/umask/umask.go generated vendored Normal file
View File

@ -0,0 +1,58 @@
package umask
import (
"fmt"
"os"
"path/filepath"
)
// MkdirAllIgnoreUmask creates a directory by ignoring the currently set umask.
func MkdirAllIgnoreUmask(dir string, mode os.FileMode) error {
parent := dir
dirs := []string{}
// Find all parent directories which would have been created by MkdirAll
for {
if _, err := os.Stat(parent); err == nil {
break
} else if !os.IsNotExist(err) {
return fmt.Errorf("cannot stat %s: %w", dir, err)
}
dirs = append(dirs, parent)
newParent := filepath.Dir(parent)
// Only possible if the root paths are not existing, which would be odd
if parent == newParent {
break
}
parent = newParent
}
if err := os.MkdirAll(dir, mode); err != nil {
return fmt.Errorf("create directory %s: %w", dir, err)
}
for _, d := range dirs {
if err := os.Chmod(d, mode); err != nil {
return fmt.Errorf("chmod directory %s: %w", d, err)
}
}
return nil
}
// WriteFileIgnoreUmask write the provided data to the path by ignoring the
// currently set umask.
func WriteFileIgnoreUmask(path string, data []byte, mode os.FileMode) error {
if err := os.WriteFile(path, data, mode); err != nil {
return fmt.Errorf("write file: %w", err)
}
if err := os.Chmod(path, mode); err != nil {
return fmt.Errorf("chmod file: %w", err)
}
return nil
}

View File

@ -1,4 +1,4 @@
package version
// Version is the version of the build.
const Version = "0.52.0"
const Version = "0.53.0"

4
vendor/modules.txt vendored
View File

@ -86,7 +86,7 @@ github.com/containernetworking/cni/pkg/version
# github.com/containernetworking/plugins v1.2.0
## explicit; go 1.17
github.com/containernetworking/plugins/pkg/ns
# github.com/containers/common v0.52.0
# github.com/containers/common v0.53.0
## explicit; go 1.18
github.com/containers/common/libimage
github.com/containers/common/libimage/define
@ -280,7 +280,7 @@ github.com/docker/distribution/reference
github.com/docker/distribution/registry/api/errcode
github.com/docker/distribution/registry/api/v2
github.com/docker/distribution/registry/client/auth/challenge
# github.com/docker/docker v23.0.3+incompatible
# github.com/docker/docker v23.0.4+incompatible
## explicit
github.com/docker/docker/api
github.com/docker/docker/api/types