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 fee1775 commit b6a8d4b
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 @@ -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 {
Expand All @@ -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")
Expand Down

0 comments on commit b6a8d4b

Please sign in to comment.