diff --git a/google_guest_agent/non_windows_accounts.go b/google_guest_agent/non_windows_accounts.go index 0c340228..04f87341 100644 --- a/google_guest_agent/non_windows_accounts.go +++ b/google_guest_agent/non_windows_accounts.go @@ -198,7 +198,7 @@ func getPasswd(user string) (*passwdEntry, error) { colon := []byte{':'} parse := func(line []byte) (*passwdEntry, error) { - if !bytes.Contains(line, prefix) || bytes.Count(line, colon) < 6 { + if !bytes.HasPrefix(line, prefix) || bytes.Count(line, colon) < 6 { return nil, nil } // kevin:x:1005:1006::/home/kevin:/usr/bin/zsh