From 226dfab0bc9f42bbda30bc998eeb32a973fd548d Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 2 Jul 2021 12:15:44 -0700 Subject: [PATCH] libct/user: ParseGroupFilter: use TrimSpace Same as in other places (other parsers here, as well as golang os/user parser and glibc parser all tolerate extra space at BOL and EOL). Signed-off-by: Kir Kolyshkin --- libcontainer/user/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcontainer/user/user.go b/libcontainer/user/user.go index dad473d87..d1601d679 100644 --- a/libcontainer/user/user.go +++ b/libcontainer/user/user.go @@ -187,7 +187,7 @@ func ParseGroupFilter(r io.Reader, filter func(Group) bool) ([]Group, error) { ) for s.Scan() { - text := s.Bytes() + text := bytes.TrimSpace(s.Bytes()) if len(text) == 0 { continue }