From 2cff3cf5c39ab8a205265ba511f627b2c5c71bce Mon Sep 17 00:00:00 2001 From: fcd <1352288+femnad@users.noreply.github.com> Date: Sun, 24 Dec 2023 07:22:41 +0300 Subject: [PATCH] fix: correctly set sudo when running usermod --- provision/useringroup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provision/useringroup.go b/provision/useringroup.go index 327a1d0..0605cb8 100644 --- a/provision/useringroup.go +++ b/provision/useringroup.go @@ -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 }