D6091: Fixup protocol mismatch between greeter and kcheckpass

Fabian Vogt noreply at phabricator.kde.org
Sun Jun 4 18:49:04 UTC 2017


fvogt created this revision.
Restricted Application added a project: Plasma.

REVISION SUMMARY
  The receiver (kcheckpass) reads a string and if it is !nullptr, reads an int:
  
  msg = GRecvStr ();
  	if (msg && (GRecvInt() & IsPassword) && !*msg)
  
  The sender (kscreenlocker_greet) sends a string and if it is not empty,
  sends an int:
  
  GSendStr(m_password.toUtf8().constData());
  	if (!m_password.isEmpty()) {
  
    		// IsSecret
    		GSendInt(1);
  
  }
  
  This does not work out for empty strings, as those still have a length of 1,
  resulting in kcheckpass waiting indefinitely for an int that does not get sent.
  Testing for a nullptr on the sender side instead of the string length fixes this.
  
  Also clean up the code duplication and IsSecret (1)/IsPassword (2) mismatch.
  
  BUG: 380491

TEST PLAN
  Reproduced the bug without this patch, with this patch it does not
  happen anymore. Authentication still works and fails as expected.

REPOSITORY
  R133 KScreenLocker

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D6091

AFFECTED FILES
  greeter/authenticator.cpp

To: fvogt, #plasma
Cc: plasma-devel, ZrenBot, spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170604/59b43c32/attachment.html>


More information about the Plasma-devel mailing list