Skip to content

Commit

Permalink
Bump github.com/containers/image/v5 from 5.10.2 to 5.10.3
Browse files Browse the repository at this point in the history
Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.10.2 to 5.10.3.
- [Release notes](https://github.com/containers/image/releases)
- [Commits](containers/image@v5.10.2...v5.10.3)

Signed-off-by: dependabot-preview[bot] <[email protected]>
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
dependabot-preview[bot] authored and rhatdan committed Feb 23, 2021
1 parent d50197a commit 42cf8e0
Show file tree
Hide file tree
Showing 51 changed files with 1,329 additions and 395 deletions.
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ go 1.15
require (
github.com/BurntSushi/toml v0.3.1
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/containers/image/v5 v5.10.2
github.com/containers/storage v1.25.0
github.com/containers/image/v5 v5.10.3
github.com/containers/storage v1.26.0
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker v17.12.0-ce-rc1.0.20201020191947-73dc6a680cdd+incompatible
github.com/docker/go-units v0.4.0
github.com/ghodss/yaml v1.0.0
github.com/google/go-cmp v0.5.2 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/go-multierror v1.1.0
github.com/onsi/ginkgo v1.15.0
github.com/onsi/gomega v1.10.5
github.com/opencontainers/runc v1.0.0-rc91
github.com/opencontainers/runtime-spec v1.0.3-0.20200710190001-3e4195d92445
github.com/opencontainers/runc v1.0.0-rc93
github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d
github.com/opencontainers/runtime-tools v0.9.0
github.com/opencontainers/selinux v1.8.0
github.com/pkg/errors v0.9.1
Expand All @@ -27,7 +26,7 @@ require (
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/sys v0.0.0-20210112080510-489259a85091
)
52 changes: 25 additions & 27 deletions go.sum

Large diffs are not rendered by default.

57 changes: 0 additions & 57 deletions pkg/chown/chown.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import (
"os"
"os/user"
"path/filepath"
"syscall"

"github.com/containers/storage/pkg/homedir"
"github.com/pkg/errors"
)

// DangerousHostPath validates if a host path is dangerous and should not be modified
Expand Down Expand Up @@ -65,58 +63,3 @@ func DangerousHostPath(path string) (bool, error) {

return false, nil
}

// ChangeHostPathOwnership changes the uid and gid ownership of a directory or file within the host.
// This is used by the volume U flag to change source volumes ownership
func ChangeHostPathOwnership(path string, recursive bool, uid, gid int) error {
// Validate if host path can be chowned
isDangerous, err := DangerousHostPath(path)
if err != nil {
return errors.Wrapf(err, "failed to validate if host path is dangerous")
}

if isDangerous {
return errors.Errorf("chowning host path %q is not allowed. You can manually `chown -R %d:%d %s`", path, uid, gid, path)
}

// Chown host path
if recursive {
err := filepath.Walk(path, func(filePath string, f os.FileInfo, err error) error {
if err != nil {
return err
}

// Get current ownership
currentUID := int(f.Sys().(*syscall.Stat_t).Uid)
currentGID := int(f.Sys().(*syscall.Stat_t).Gid)

if uid != currentUID || gid != currentGID {
return os.Lchown(filePath, uid, gid)
}

return nil
})

if err != nil {
return errors.Wrapf(err, "failed to chown recursively host path")
}
} else {
// Get host path info
f, err := os.Lstat(path)
if err != nil {
return errors.Wrapf(err, "failed to get host path information")
}

// Get current ownership
currentUID := int(f.Sys().(*syscall.Stat_t).Uid)
currentGID := int(f.Sys().(*syscall.Stat_t).Gid)

if uid != currentUID || gid != currentGID {
if err := os.Lchown(path, uid, gid); err != nil {
return errors.Wrapf(err, "failed to chown host path")
}
}
}

return nil
}
66 changes: 66 additions & 0 deletions pkg/chown/chown_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// +build !windows

package chown

import (
"os"
"path/filepath"
"syscall"

"github.com/pkg/errors"
)

// ChangeHostPathOwnership changes the uid and gid ownership of a directory or file within the host.
// This is used by the volume U flag to change source volumes ownership
func ChangeHostPathOwnership(path string, recursive bool, uid, gid int) error {
// Validate if host path can be chowned
isDangerous, err := DangerousHostPath(path)
if err != nil {
return errors.Wrapf(err, "failed to validate if host path is dangerous")
}

if isDangerous {
return errors.Errorf("chowning host path %q is not allowed. You can manually `chown -R %d:%d %s`", path, uid, gid, path)
}

// Chown host path
if recursive {
err := filepath.Walk(path, func(filePath string, f os.FileInfo, err error) error {
if err != nil {
return err
}

// Get current ownership
currentUID := int(f.Sys().(*syscall.Stat_t).Uid)
currentGID := int(f.Sys().(*syscall.Stat_t).Gid)

if uid != currentUID || gid != currentGID {
return os.Lchown(filePath, uid, gid)
}

return nil
})

if err != nil {
return errors.Wrapf(err, "failed to chown recursively host path")
}
} else {
// Get host path info
f, err := os.Lstat(path)
if err != nil {
return errors.Wrapf(err, "failed to get host path information")
}

// Get current ownership
currentUID := int(f.Sys().(*syscall.Stat_t).Uid)
currentGID := int(f.Sys().(*syscall.Stat_t).Gid)

if uid != currentUID || gid != currentGID {
if err := os.Lchown(path, uid, gid); err != nil {
return errors.Wrapf(err, "failed to chown host path")
}
}
}

return nil
}
11 changes: 11 additions & 0 deletions pkg/chown/chown_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package chown

import (
"github.com/pkg/errors"
)

// ChangeHostPathOwnership changes the uid and gid ownership of a directory or file within the host.
// This is used by the volume U flag to change source volumes ownership
func ChangeHostPathOwnership(path string, recursive bool, uid, gid int) error {
return errors.Errorf("windows not supported")
}
7 changes: 3 additions & 4 deletions pkg/parse/parse_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"path/filepath"

"github.com/containers/storage/pkg/unshare"
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/devices"
"github.com/pkg/errors"
)

func DeviceFromPath(device string) ([]configs.Device, error) {
var devs []configs.Device
func DeviceFromPath(device string) ([]devices.Device, error) {
var devs []devices.Device
src, dst, permissions, err := Device(device)
if err != nil {
return nil, err
Expand Down Expand Up @@ -44,7 +43,7 @@ func DeviceFromPath(device string) ([]configs.Device, error) {
}
for _, d := range srcDevices {
d.Path = filepath.Join(dst, filepath.Base(d.Path))
d.Permissions = configs.DevicePermissions(permissions)
d.Permissions = devices.Permissions(permissions)
devs = append(devs, *d)
}
return devs, nil
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/containers/storage/VERSION

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/containers/storage/containers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 42cf8e0

Please sign in to comment.