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

fix: replace return in modify-sudoers #47

Merged

Conversation

RICCIARDI-Adrien
Copy link
Contributor

Issue #, if available:
n/a

Description of changes:
Fixed a misplaced return instruction by a more appropriate exit instruction.

Why is this change necessary:
The return instruction can be used only in a function. The script crashes if the return instruction is being executed here because it is called out of a function body.

How was this change tested:
Running the script when the sudoers file was already updated was crashing the script. With the fix, the script now gracefully exits as expected.

Any additional information or context required to review the change:

Checklist:

  • Updated the README if applicable

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@MikeDombo
Copy link
Member

Interesting, thank you. Can you please adjust your commit message to comply with conventional commit format? I would suggest "fix: replace return in modify-sudoers"

Fixed a misplaced 'return' instruction by a more appropriate 'exit' instruction.
The 'return' instruction can be used only in a function.

Signed-off-by: Adrien Ricciardi <[email protected]>
@MikeDombo MikeDombo changed the title modify-sudoers.sh: Fixed a misplaced 'return' instruction by a more appropriate 'exit' instruction. fix: replace return in modify-sudoers Apr 17, 2024
@MikeDombo MikeDombo merged commit c5b98b2 into aws-greengrass:main Apr 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants