Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v15] Log debug error if user cleanup is a not found error from missing getent binaries #50580

Open
wants to merge 1 commit into
base: branch/v15
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading