Skip to content

Comments

Fix SIGINT killing micro when saving with sudo#3495

Merged
JoeKar merged 2 commits intomicro-editor:masterfrom
dmaluka:sudo-sigint-fix
Oct 12, 2024
Merged

Fix SIGINT killing micro when saving with sudo#3495
JoeKar merged 2 commits intomicro-editor:masterfrom
dmaluka:sudo-sigint-fix

Conversation

@dmaluka
Copy link
Collaborator

@dmaluka dmaluka commented Oct 6, 2024

When we are saving a file with sudo, if we interrupt sudo via Ctrl-c, it doesn't just kill sudo, it kills micro itself.

The cause is the same as the similar issue #2612 for RunInteractiveShell() which was fixed by #3357. So fix it the same way as in #3357.

Also on top of that, fix the lack of error reporting when saving with sudo fails.

When we are saving a file with sudo, if we interrupt sudo via Ctrl-c,
it doesn't just kill sudo, it kills micro itself.

The cause is the same as in the issue micro-editor#2612 for RunInteractiveShell()
which was fixed by micro-editor#3357. So fix it the same way as in micro-editor#3357.
When saving a file with sudo fails (e.g. if we set `sucmd` to a
non-existent binary, e.g. `set sucmd aaa`), we erroneously return
success instead of the error, as a result we report to the user that
that the file has been successfully saved. Fix it.
@JoeKar JoeKar merged commit d60413f into micro-editor:master Oct 12, 2024
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