Work around a race with password-less logins and double clicks#1
Open
Work around a race with password-less logins and double clicks#1
Conversation
There is a race in the greeter (greeter as in lightdm-gtk-greeter) easily triggered by double-clicking on the login button (or clicking it with a bouncing mouse button) with a password-less login. The problem arises when the daemon has already sent SERVER_MESSAGE_END_AUTHENTICATION to the greeter, but before it digests it, it handles more X11 events (e.g. the second click), sending the daemon a GREETER_MESSAGE_CONTINUE_AUTHENTICATION (before the GREETER_MESSAGE_START_SESSION) which will confuse handle_continue_authentication(), making it call session_respond_error(), which then sends a PAM_CONV_ERR to the session child, which will in turn get confused because it's expecting the (length of the) session error file name. As I don't really know how to avoid the race in the greeter (you would need to teach it prioritizing messages from the master over messages from X11), work around it by setting a flag in GreeterPrivate if SERVER_MESSAGE_END_AUTHENTICATION has been sent and ignore GREETER_MESSAGE_CONTINUE_AUTHENTICATION if that flag is set. The change was verified on 1.18.3 and then adopted to HEAD.
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.
There is a race in the greeter (greeter as in lightdm-gtk-greeter) easily triggered by double-clicking on the login button (or clicking it with a bouncing mouse button) with a password-less login.
The problem arises when the daemon has already sent
SERVER_MESSAGE_END_AUTHENTICATIONto the greeter, but before it digests it, it handles more X11 events (e.g. the second click), sending the daemon aGREETER_MESSAGE_CONTINUE_AUTHENTICATION(before theGREETER_MESSAGE_START_SESSION) which will confusehandle_continue_authentication(), making it callsession_respond_error(), which then sends aPAM_CONV_ERRto the session child, which will in turn get confused because it's expecting the (length of the) session error file name.As I don't really know how to avoid the race in the greeter (you would need to teach it prioritising messages from the master over messages from X11), work around it by setting a flag in
GreeterPrivatewhenSERVER_MESSAGE_END_AUTHENTICATIONhas been sent and ignoreGREETER_MESSAGE_CONTINUE_AUTHENTICATIONif that flag is set.The change was verified on 1.18.3 and then adopted to HEAD.