From 1d558b0bda448c839f784a5dfa208782f90972f6 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 20 Apr 2010 01:49:53 +0000 Subject: Security update to kdesktop_lock git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1116659 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdesktop/lock/lockprocess.cc | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index 1e4e64940..685864d10 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -67,6 +67,7 @@ #include #include +#include #include @@ -104,7 +105,7 @@ Status DPMSInfo ( Display *, CARD16 *, BOOL * ); // These lines are taken on 10/2009 from X.org (X11/XF86keysym.h), defining some special multimedia keys #define XF86XK_AudioMute 0x1008FF12 #define XF86XK_AudioRaiseVolume 0x1008FF13 -#define XF86XK_AudioLowerVolume 0x1008FF +#define XF86XK_AudioLowerVolume 0x1008FF11 #define XF86XK_Display 0x1008FF59 static Window gVRoot = 0; @@ -112,6 +113,11 @@ static Window gVRootData = 0; static Atom gXA_VROOT; static Atom gXA_SCREENSAVER_VERSION; +static void segv_handler(int) +{ + printf("[kdesktop_lock] WARNING: A fatal exception was encountered. Trapping and ignoring it so as not to compromise desktop security...\n\r"); +} + //=========================================================================== // // Screen saver handling process. Handles screensaver window, @@ -206,6 +212,8 @@ LockProcess::LockProcess(bool child, bool useBlankOnly) #endif greetPlugin.library = 0; + + KCrash::setCrashHandler(segv_handler); } //--------------------------------------------------------------------------- @@ -638,10 +646,14 @@ void LockProcess::createSaverWindow() void LockProcess::desktopResized() { + if (currentDialog != NULL) { + mForceReject = true; + currentDialog->close(); + } + // Get root window size XWindowAttributes rootAttr; - XGetWindowAttributes(qt_xdisplay(), RootWindow(qt_xdisplay(), - qt_xscreen()), &rootAttr); + XGetWindowAttributes(qt_xdisplay(), RootWindow(qt_xdisplay(), qt_xscreen()), &rootAttr); mRootWidth = rootAttr.width; mRootHeight = rootAttr.height; @@ -650,11 +662,6 @@ void LockProcess::desktopResized() // Restart the hack as the window size is now different stopHack(); startHack(); - - if (currentDialog != NULL) { - mForceReject = true; - currentDialog->close(); - } } //--------------------------------------------------------------------------- -- cgit v1.2.1