mirror of
https://github.com/containers/skopeo.git
synced 2025-09-25 12:16:17 +00:00
Bump github.com/containers/storage from 1.33.1 to 1.33.2
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.33.1 to 1.33.2. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.33.1...v1.33.2) --- updated-dependencies: - dependency-name: github.com/containers/storage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
committed by
Daniel J Walsh
parent
678682f128
commit
be821b4f59
12
vendor/github.com/containers/storage/pkg/idtools/idtools.go
generated
vendored
12
vendor/github.com/containers/storage/pkg/idtools/idtools.go
generated
vendored
@@ -146,11 +146,11 @@ type IDMappings struct {
|
||||
// using the data from /etc/sub{uid,gid} ranges, creates the
|
||||
// proper uid and gid remapping ranges for that user/group pair
|
||||
func NewIDMappings(username, groupname string) (*IDMappings, error) {
|
||||
subuidRanges, err := parseSubuid(username)
|
||||
subuidRanges, err := readSubuid(username)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
subgidRanges, err := parseSubgid(groupname)
|
||||
subgidRanges, err := readSubgid(groupname)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -244,14 +244,6 @@ func createIDMap(subidRanges ranges) []IDMap {
|
||||
return idMap
|
||||
}
|
||||
|
||||
func parseSubuid(username string) (ranges, error) {
|
||||
return parseSubidFile(subuidFileName, username)
|
||||
}
|
||||
|
||||
func parseSubgid(username string) (ranges, error) {
|
||||
return parseSubidFile(subgidFileName, username)
|
||||
}
|
||||
|
||||
// parseSubidFile will read the appropriate file (/etc/subuid or /etc/subgid)
|
||||
// and return all found ranges for a specified username. If the special value
|
||||
// "ALL" is supplied for username, then all ranges in the file will be returned
|
||||
|
61
vendor/github.com/containers/storage/pkg/idtools/idtools_supported.go
generated
vendored
Normal file
61
vendor/github.com/containers/storage/pkg/idtools/idtools_supported.go
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
// +build linux,cgo,!no_libsubid
|
||||
|
||||
package idtools
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -l subid
|
||||
#include <shadow/subid.h>
|
||||
#include <stdlib.h>
|
||||
const char *Prog = "storage";
|
||||
struct subid_range get_range(struct subid_range *ranges, int i)
|
||||
{
|
||||
return ranges[i];
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
func readSubid(username string, isUser bool) (ranges, error) {
|
||||
var ret ranges
|
||||
if username == "ALL" {
|
||||
return nil, errors.New("username ALL not supported")
|
||||
}
|
||||
|
||||
cUsername := C.CString(username)
|
||||
defer C.free(unsafe.Pointer(cUsername))
|
||||
|
||||
var nRanges C.int
|
||||
var cRanges *C.struct_subid_range
|
||||
if isUser {
|
||||
nRanges = C.get_subuid_ranges(cUsername, &cRanges)
|
||||
} else {
|
||||
nRanges = C.get_subgid_ranges(cUsername, &cRanges)
|
||||
}
|
||||
if nRanges < 0 {
|
||||
return nil, errors.New("cannot read subids")
|
||||
}
|
||||
defer C.free(unsafe.Pointer(cRanges))
|
||||
|
||||
for i := 0; i < int(nRanges); i++ {
|
||||
r := C.get_range(cRanges, C.int(i))
|
||||
newRange := subIDRange{
|
||||
Start: int(r.start),
|
||||
Length: int(r.count),
|
||||
}
|
||||
ret = append(ret, newRange)
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func readSubuid(username string) (ranges, error) {
|
||||
return readSubid(username, true)
|
||||
}
|
||||
|
||||
func readSubgid(username string) (ranges, error) {
|
||||
return readSubid(username, false)
|
||||
}
|
11
vendor/github.com/containers/storage/pkg/idtools/idtools_unsupported.go
generated
vendored
Normal file
11
vendor/github.com/containers/storage/pkg/idtools/idtools_unsupported.go
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
// +build !linux no_libsubid !cgo
|
||||
|
||||
package idtools
|
||||
|
||||
func readSubuid(username string) (ranges, error) {
|
||||
return parseSubidFile(subuidFileName, username)
|
||||
}
|
||||
|
||||
func readSubgid(username string) (ranges, error) {
|
||||
return parseSubidFile(subgidFileName, username)
|
||||
}
|
8
vendor/github.com/containers/storage/pkg/idtools/usergroupadd_linux.go
generated
vendored
8
vendor/github.com/containers/storage/pkg/idtools/usergroupadd_linux.go
generated
vendored
@@ -91,7 +91,7 @@ func createSubordinateRanges(name string) error {
|
||||
|
||||
// first, we should verify that ranges weren't automatically created
|
||||
// by the distro tooling
|
||||
ranges, err := parseSubuid(name)
|
||||
ranges, err := readSubuid(name)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error while looking for subuid ranges for user %q: %v", name, err)
|
||||
}
|
||||
@@ -107,7 +107,7 @@ func createSubordinateRanges(name string) error {
|
||||
}
|
||||
}
|
||||
|
||||
ranges, err = parseSubgid(name)
|
||||
ranges, err = readSubgid(name)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error while looking for subgid ranges for user %q: %v", name, err)
|
||||
}
|
||||
@@ -126,7 +126,7 @@ func createSubordinateRanges(name string) error {
|
||||
}
|
||||
|
||||
func findNextUIDRange() (int, error) {
|
||||
ranges, err := parseSubuid("ALL")
|
||||
ranges, err := readSubuid("ALL")
|
||||
if err != nil {
|
||||
return -1, fmt.Errorf("Couldn't parse all ranges in /etc/subuid file: %v", err)
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func findNextUIDRange() (int, error) {
|
||||
}
|
||||
|
||||
func findNextGIDRange() (int, error) {
|
||||
ranges, err := parseSubgid("ALL")
|
||||
ranges, err := readSubgid("ALL")
|
||||
if err != nil {
|
||||
return -1, fmt.Errorf("Couldn't parse all ranges in /etc/subgid file: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user