Update module github.com/containers/storage to v1.45.3

Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
renovate[bot]
2023-01-20 13:10:14 +00:00
committed by Miloslav Trmač
parent a98c137243
commit 850bc49d27
6 changed files with 15 additions and 8 deletions

View File

@@ -1 +1 @@
1.45.1
1.45.3

View File

@@ -173,6 +173,9 @@ func DefaultConfigFile(rootless bool) (string, error) {
return path, nil
}
if !rootless {
if _, err := os.Stat(defaultOverrideConfigFile); err == nil {
return defaultOverrideConfigFile, nil
}
return defaultConfigFile, nil
}

View File

@@ -78,6 +78,10 @@ func (s *store) getAvailableIDs() (*idSet, *idSet, error) {
return u, g, nil
}
// nobodyUser returns the UID and GID of the "nobody" user. Hardcode its value
// for simplicity.
const nobodyUser = 65534
// parseMountedFiles returns the maximum UID and GID found in the /etc/passwd and
// /etc/group files.
func parseMountedFiles(containerMount, passwdFile, groupFile string) uint32 {
@@ -98,10 +102,10 @@ func parseMountedFiles(containerMount, passwdFile, groupFile string) uint32 {
if u.Name == "nobody" {
continue
}
if u.Uid > size {
if u.Uid > size && u.Uid != nobodyUser {
size = u.Uid
}
if u.Gid > size {
if u.Gid > size && u.Gid != nobodyUser {
size = u.Gid
}
}
@@ -113,7 +117,7 @@ func parseMountedFiles(containerMount, passwdFile, groupFile string) uint32 {
if g.Name == "nobody" {
continue
}
if g.Gid > size {
if g.Gid > size && g.Gid != nobodyUser {
size = g.Gid
}
}