From 34139b448f979b17e07276a346d03f114d486f87 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 81f82977bab18..6e20963ae7a59 100644 --- a/lib/utils/host/hostusers.go +++ b/lib/utils/host/hostusers.go @@ -129,7 +129,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 { @@ -151,7 +151,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")