Synergy

Issue Tracker (powered by SPIT)

Bug #3311 - Client/server restart for elevation even when they're already elevated

Status:
Accepted
Priority:
High
Assignee:
None
Category:
None
Target:
None
Found:
1.4.15
Created by:
Created on:
31 Jul 2012 21:33
Updated by:
Updated on:
16 Jul 2014 14:07
Platform:
Windows
Google ID:
None
Redmine ID:
None

  • Duplicated by: Support #3570 - Connection to client interrupted with UAC prompt

  1. Check the "Elevate" option
  2. Click Apply
  3. Cause a UAC dialog to display

Expected: Mouse is usable immediately

Actual: Mouse can't be used for ~5 secs while server/client restarts for elevation (when already elevated)


31 Jul 2012 22:13: Nick Bolton changed Priority.

Normal High


#1

15 Apr 2013 12:31: Henry Tung wrote a comment.

Hmm, found what seems to be a possible fix for this bug: the GUI sets the flag to restart the client on desktop switch, ostensibly for the purpose of elevation (when elevation wasn't a GUI config option?). Changing this seemed to make the UAC restart pause disappear, in the 30 seconds of testing I did. :p

diff -Naur synergy-1.4.12-Source.orig/src/gui/src/MainWindow.cpp synergy-1.4.12-Source/src/gui/src/MainWindow.cpp --- synergy-1.4.12-Source.orig/src/gui/src/MainWindow.cpp 2013-04-11 09:51:17.000000000 -0700 +++ synergy-1.4.12-Source/src/gui/src/MainWindow.cpp 2013-04-15 03:54:16.200377400 -0700 @@ -400,7 +400,9 @@ // is switched; this is because we may need to elevate or not // based on which desk the user is in (login always needs // elevation, where as default desk does not). - args << "--stop-on-desk-switch"; + if (!m_ElevateProcess) { + args << "--stop-on-desk-switch"; + } #endif }

Tried it on the 1.4.11 release as well as the r1750 nightly, both behave consistently (i.e. bug without patch, fixed after).

Of note: the bug also occurs exactly the same way with KeePass' "secure desktop" option, which I discovered doesn't actually use the UAC desktop but rather creates its own and emulates the same appearance; since I used the same thing for my desktop switching launcher, the bug also happened with that. Bug is definitely linked to the desktop switch in particular, not the elevation.

Anyhow, hope this helps!


#2

15 Apr 2013 12:33: Henry Tung wrote a comment.

And now, the patch hopefully without formatting goof:

diff -Naur synergy-1.4.12-Source.orig/src/gui/src/MainWindow.cpp synergy-1.4.12-Source/src/gui/src/MainWindow.cpp --- synergy-1.4.12-Source.orig/src/gui/src/MainWindow.cpp 2013-04-11 09:51:17.000000000 -0700 +++ synergy-1.4.12-Source/src/gui/src/MainWindow.cpp 2013-04-15 03:54:16.200377400 -0700 @@ -400,7 +400,9 @@ // is switched; this is because we may need to elevate or not // based on which desk the user is in (login always needs // elevation, where as default desk does not). - args << "--stop-on-desk-switch"; + if (!m_ElevateProcess) { + args << "--stop-on-desk-switch"; + } #endif }


#3

15 Apr 2013 12:33: Henry Tung wrote a comment.

I GIVE UP

http://pastebin.com/C4Xe9wVa


#4

17 Jul 2013 07:01: Henry Tung wrote a comment.

I now understand how markdown works

diff -Naur synergy-1.4.12-Source.orig/src/gui/src/MainWindow.cpp synergy-1.4.12-Source/src/gui/src/MainWindow.cpp
--- synergy-1.4.12-Source.orig/src/gui/src/MainWindow.cpp   2013-04-11 09:51:17.000000000 -0700
+++ synergy-1.4.12-Source/src/gui/src/MainWindow.cpp    2013-04-15 03:54:16.200377400 -0700
@@ -400,7 +400,9 @@
        // is switched; this is because we may need to elevate or not
        // based on which desk the user is in (login always needs
        // elevation, where as default desk does not).
-       args << "--stop-on-desk-switch";
+       if (!m_ElevateProcess) {
+           args << "--stop-on-desk-switch";
+       }
 #endif
    }

18 Feb 2014 09:04: The Wes changed Found.

1.4.15


18 Feb 2014 09:04: The Wes changed Target.

1.4.16


18 Feb 2014 09:04: The Wes changed Platform.

Windows


18 Feb 2014 09:05: The Wes changed Target.

1.4.16 1.4.17


25 Feb 2014 11:43: changed Target.

1.4.17 1.4.18


#5

2 Apr 2014 07:30: Dan Polivy wrote a comment.

FWIW, I applied this fix to my local source copy of 1.4.17 and it fixed the issue for me. Would be great to have this integrated into the official branch!


16 May 2014 12:13: Nick Bolton changed Target.

1.4.18 1.5.0


#6

21 May 2014 20:33: Rube Rodrigu wrote a comment.

Another satisfied hacker chiming in to say that I applied the simple patch above and have no service interruption during UAC prompts!


16 Jul 2014 14:07: Nick Bolton changed Target.

1.5.1