From e899b7beb6b0f2db8c08dfdc14c29efb99046086 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 27 Apr 2012 03:19:38 -0500 Subject: Harden lock against rare race condition that caused two password prompts to appear Provide alternate secure dialog text string when username cannot be obtained --- kdesktop/lock/lockprocess.cc | 2 ++ kdesktop/lock/securedlg.cc | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'kdesktop') diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index f1426194e..2b47661db 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -1542,6 +1542,7 @@ void LockProcess::displayLockDialogIfNeeded() mBusy = true; if (mLocked) { if (checkPass()) { + trinity_desktop_lock_closing_windows = true; stopSaver(); kapp->quit(); } @@ -1882,6 +1883,7 @@ bool LockProcess::x11Event(XEvent *event) else { if (!mLocked || checkPass()) { + trinity_desktop_lock_closing_windows = true; stopSaver(); kapp->quit(); } diff --git a/kdesktop/lock/securedlg.cc b/kdesktop/lock/securedlg.cc index 717d98cc0..08a70a17d 100644 --- a/kdesktop/lock/securedlg.cc +++ b/kdesktop/lock/securedlg.cc @@ -91,7 +91,12 @@ SecureDlg::SecureDlg(LockProcess *parent) if (userString == "") { userString = user.loginName(); } - mLogonStatus->setText(i18n("'%1' is currently logged on").arg( user.fullName() )); + if (userString != "") { + mLogonStatus->setText(i18n("'%1' is currently logged on").arg( user.fullName() )); + } + else { + mLogonStatus->setText(i18n("You are currently logged on")); // We should never get here, and this message is somewhat obtuse, but it is better than displaying two qotation marks with no text between them... + } KSeparator *sep = new KSeparator( KSeparator::HLine, frame ); -- cgit v1.2.3