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

save: Restore the screen before overwriteFile() is left #2967

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

JoeKar
Copy link
Collaborator

@JoeKar JoeKar commented Oct 14, 2023

This will solve the crash which was 100% reproducible in the moment the privilege escalation failed due to endless temporary shutdown of the screen.

Fixes #2823
Fixes #2960

...otherwise there is no screen anymore to draw a possible error message.
dmaluka added a commit to dmaluka/micro that referenced this pull request Oct 15, 2023
Similarly to the crash fixed by zyedidia#2967, which happens if sudo failed,
a crash also happens when sudo even fails to start. The reason for
the crash is also similar: nil dereference of screen.Screen caused by
the fact that we do not restore temporarily disabled screen.

To reproduce this crash, set the `sucmd` option to some non-existing
command, e.g. `aaa`, and try to save a file with root privileges.
zyedidia pushed a commit that referenced this pull request Oct 16, 2023
Similarly to the crash fixed by #2967, which happens if sudo failed,
a crash also happens when sudo even fails to start. The reason for
the crash is also similar: nil dereference of screen.Screen caused by
the fact that we do not restore temporarily disabled screen.

To reproduce this crash, set the `sucmd` option to some non-existing
command, e.g. `aaa`, and try to save a file with root privileges.
@zyedidia zyedidia merged commit db5fcf1 into zyedidia:master Oct 16, 2023
3 checks passed
@JoeKar JoeKar deleted the fix/crash-on-save-sudo branch December 11, 2023 19:25
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.

panic (no disco involved) Crash on failed/exited privilege escalation
2 participants