Skip to content

Commit

Permalink
host users: log missing binaries at debug level
Browse files Browse the repository at this point in the history
Manual backport of #42373
  • Loading branch information
zmb3 committed Dec 26, 2024
1 parent db720f6 commit 34139b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils/host/hostusers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
Expand Down

0 comments on commit 34139b4

Please sign in to comment.