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:
Paul Holzinger
2023-09-12 15:30:07 +02:00
parent 18561f26ad
commit 2c2299ad85
155 changed files with 12220 additions and 14157 deletions

View File

@@ -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