mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
bump buildah to latest
Also includes a small change to make us of https://github.com/containers/buildah/pull/5039 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
20
vendor/github.com/containers/buildah/pkg/chrootuser/user_unix.go
generated
vendored
20
vendor/github.com/containers/buildah/pkg/chrootuser/user_unix.go
generated
vendored
@@ -92,6 +92,19 @@ type lookupGroupEntry struct {
|
||||
user string
|
||||
}
|
||||
|
||||
func scanWithoutComments(rc *bufio.Scanner) (string, bool) {
|
||||
for {
|
||||
if !rc.Scan() {
|
||||
return "", false
|
||||
}
|
||||
line := rc.Text()
|
||||
if strings.HasPrefix(strings.TrimSpace(line), "#") {
|
||||
continue
|
||||
}
|
||||
return line, true
|
||||
}
|
||||
}
|
||||
|
||||
func parseNextPasswd(rc *bufio.Scanner) *lookupPasswdEntry {
|
||||
if !rc.Scan() {
|
||||
return nil
|
||||
@@ -118,10 +131,13 @@ func parseNextPasswd(rc *bufio.Scanner) *lookupPasswdEntry {
|
||||
}
|
||||
|
||||
func parseNextGroup(rc *bufio.Scanner) *lookupGroupEntry {
|
||||
if !rc.Scan() {
|
||||
// On FreeBSD, /etc/group may contain comments:
|
||||
// https://man.freebsd.org/cgi/man.cgi?query=group&sektion=5&format=html
|
||||
// We need to ignore those lines rather than trying to parse them.
|
||||
line, ok := scanWithoutComments(rc)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
line := rc.Text()
|
||||
fields := strings.Split(line, ":")
|
||||
if len(fields) != 4 {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user