Skip to content

Commit

Permalink
Try not to disable/enable a user when changing password
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Nov 18, 2024
1 parent fd2ba72 commit 384fb4c
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions internal/ipmi/ipmitool.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,21 +391,10 @@ func (i *Ipmitool) createUser(req bmcRequest) (string, error) {
}

func (i *Ipmitool) changePassword(req bmcRequest) (string, error) {
err := i.setUserEnabled(req, false)
if err != nil {
return "", err
}

pw, err := req.setPasswordFunc()
if err != nil {
return "", fmt.Errorf("failed to set password %s for user %s with id %s %w", pw, req.username, req.uid, err)
}

err = i.setUserEnabled(req, true)
if err != nil {
return "", err
}

return pw, nil
}

Expand Down

0 comments on commit 384fb4c

Please sign in to comment.