From 306e2b0514575235280f51c0fbadecc737fa832c Mon Sep 17 00:00:00 2001 From: James Sapara Date: Fri, 1 Jun 2018 10:37:25 -0700 Subject: [PATCH] strip space and ignore empty users from who --- security/users.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/users.go b/security/users.go index 9bcab534..b8fe5164 100644 --- a/security/users.go +++ b/security/users.go @@ -59,7 +59,8 @@ func loggedInUsersLinux() []string { if len(col) > 0 { for _, cleanedU := range cleaned { - if strings.Compare(cleanedU, col[0]) == 0 { + u := strings.TrimSpace(col[0]) + if len(u) == 0 || strings.Compare(cleanedU, col[0]) == 0 { clean = false } }