Prevent Crash if Closing the DASD Context Menu without Action [SLE-15-SP5]#103
Merged
shundhammer merged 2 commits intoSLE-15-SP5from May 10, 2023
Merged
Prevent Crash if Closing the DASD Context Menu without Action [SLE-15-SP5]#103shundhammer merged 2 commits intoSLE-15-SP5from
shundhammer merged 2 commits intoSLE-15-SP5from
Conversation
b71dbe9 to
3aa139e
Compare
Contributor
|
✔️ Internal Jenkins job #757 successfully finished |
Contributor
|
✔️ Internal Jenkins job #758 successfully finished |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Target Branch / Release
This is for SLE-15-SP5. The merge to master is #104.
Bugzilla
https://bugzilla.suse.com/show_bug.cgi?id=1211213
Problem
Closing the context menu of the DASD list without executing any of its actions (e.g. by clicking outside the context menu or with the [Esc] key) caused a hard crash:
Cause
The
UI.YContextMenuused here sends aCancelEvent(ID:cancel) when the user closes the menu without action. The yast-s390 code simply converted the received ID into a Ruby symbol for an action class to be executed and tried to run that class.Fix
Now explicitly catching action
:canceland ignoring it.Now generally checking if there actually is an action class for that symbol and logging an error instead of just crashing:
Test
Manual test with mocked data as described here:
Esckey to close itNo complaint should appear in the log for this
:cancelaction.return false if action == :cancelline and trying again: Now there should be an error in the y2logNo action for cancel: uninitialized constant Y2S390::DasdActions::Cancel.Other affected Places in YaST
This one place in the yast2-s390 DASD handling is really the only place (that we found) all over YaST where we use that YContextMenu, so the problem should not appear anywhere else.
Fix in the UI
The behavior of that YContextMenu is very weird. Closing a menu without any action should never send any event (i.e. make
UI.UserInput()return any value); it should just silently close the menu, and that should be it.But that behavior has been unchanged since 15 years ago, so there is the slight chance that other Open Source software which uses libyui may be affected. But sending a
CancelEventin that case is almost certainly always unwelcome, so fixing it also in our own upstream libyui-qt should only be an improvement.Related PR