From b6a8d4b15da60c9e48e419d6a5b271f00da48d69 Mon Sep 17 00:00:00 2001 From: Zac Bergquist Date: Thu, 26 Dec 2024 10:49:58 -0700 Subject: [PATCH] host users: log missing binaries at debug level Manual backport of #42373 --- lib/utils/host/hostusers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils/host/hostusers.go b/lib/utils/host/hostusers.go index 1e7f50e47b523..3123d1a5d8879 100644 --- a/lib/utils/host/hostusers.go +++ b/lib/utils/host/hostusers.go @@ -155,7 +155,7 @@ func SetUserGroups(username string, groups []string) (exitCode int, err error) { func UserDel(username string) (exitCode int, err error) { userdelBin, err := exec.LookPath("userdel") if err != nil { - return -1, trace.Wrap(err, "cant find userdel binary") + return -1, trace.NotFound("cant find userdel binary: %s", err) } u, err := user.Lookup(username) if err != nil { @@ -177,7 +177,7 @@ func UserDel(username string) (exitCode int, err error) { func GetAllUsers() ([]string, int, error) { getentBin, err := exec.LookPath("getent") if err != nil { - return nil, -1, trace.Wrap(err, "cant find getent binary") + return nil, -1, trace.NotFound("cant find getent binary: %s", err) } // getent passwd cmd := exec.Command(getentBin, "passwd")