Skip to content

Commit

Permalink
fix: correctly set sudo when running usermod
Browse files Browse the repository at this point in the history
  • Loading branch information
femnad committed Dec 24, 2023
1 parent 7919902 commit 2cff3cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion provision/useringroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func addUserToGroup(user, group string) error {

internal.Log.Infof("Adding user %s to group %s", user, group)
usermod := fmt.Sprintf("usermod -aG %s %s", group, user)
_, err = marecmd.RunFormatError(marecmd.Input{Command: usermod, Sudo: isRoot})
_, err = marecmd.RunFormatError(marecmd.Input{Command: usermod, Sudo: !isRoot})
if err != nil {
return err
}
Expand Down

0 comments on commit 2cff3cf

Please sign in to comment.