Synergy-core: UAC causes disconnection while in elevate mode

Created on 13 Oct 2014  路  15Comments  路  Source: symless/synergy-core

Imported issue:

  • Author: Nick Bolton
  • Date: 2012-07-31 21:33:12
  • Legacy ID: 3311
  • Version: 1.4.15
  • Check the "Elevate" option
  • Click Apply
  • 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)

bug

Most helpful comment

Retested bug with RC2 for regressions:

SRV: synergy-v1.8.3-rc2-89c9c58-Linux-x86_64
CLN: synergy-v1.8.3-rc2-89c9c58-Windows-x64

Issue #3241

  1. Open GUI on Windows
  2. Ensure client mode is used
  3. Go to Edit->Settings
  4. For Elevate mode, select 'Always'
  5. Click OK, then click Apply
  6. Press Win+R
  7. Paste: C : \ Windows \ System32 \ UserAccountControlSettings . exe
  8. Make a note of your current setting
  9. Set notify level to highest level (always notify)
  10. Click OK, then click Yes
  11. Press Win+R
  12. Paste: C : \ Windows \ System32 \ UserAccountControlSettings . exe
  13. Synergy should stay connected when UAC dialog appears
  14. Cancel the UAC dialog
  15. Change your setting back to the original

PASSED. Synergy stayed connected.

All 15 comments

  • Author: Henry Tung
  • Date: 2013-04-15 12:31:54

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!

  • Author: Henry Tung
  • Date: 2013-04-15 12:33:06

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
    }
  • Author: Henry Tung
  • Date: 2013-04-15 12:33:57

I GIVE UP

http://pastebin.com/C4Xe9wVa

  • Author: Henry Tung
  • Date: 2013-07-17 07:01:05

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
    }
  • Author: Dan Polivy
  • Date: 2014-04-02 07:30:32

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!

  • Author: Rube Rodrigu
  • Date: 2014-05-21 20:33:41

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

Is this fix still relevant, and can in be incorporated into the latest builds? It really seemed to help back when I was using 1.4.x, and it seems there are a bunch of other issues here that would be solved by adding this in for all.

Quick update, I pulled the latest commits into my fork, and then re-applied this diff, and sure enough, if I run Synergy in elevated mode, then I don't lose the connection when UAC prompts appear!

The updated diff is:

@@ -527,7 +527,9 @@ void MainWindow::startSynergy()
        // 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 (!appConfig().elevateMode()) {
+           args << "--stop-on-desk-switch";
+       }
#endif
    }

I don't know what the current issues are with always running in an elevated mode, but if they're minimal or have been addressed since this was originally opened, I'd strongly suggest pulling this change in.

Subscribing, plus curious, how has this gone over a year w/o being fixed when there is a patch!?!?!? Are you waiting for a pull request? Especially considering how annoying this problem is (I actually have to restart my server to reconnect it seems -- or maybe I just dont wait long enough...).

I have been using it for about 2 days on my windows 10 laptop.
The server is an Arch linux machine with the latest stable release.

The UAC popup doesn't disconnect me anymore and it also seems to fix a similar disconnect when unlocking windows after having locked windows with win key+l

This might be a different problem.
There is a slight freeze if you move the mouse when unlocking but no disconnect.
(and that might result in a jittery mouse movement that goes back to normal after a minute or two.
The jittery mouse i can't always reproduce it so it might be unrelated or even due to my network)

Anyway it doesn't seem there is any freeze when the UAC appears/disapears so overall this a great fix and i hope it makes it to stable

Fixed by cb6012f91be4c0fe67c6d7a58dbded89dc6e0941

Is there an ETA on when this version might get released?

ssue #3241

  1. Open GUI on Windows
  2. Ensure client mode is used
  3. Go to Edit->Settings
  4. For Elevate mode, select 'Always'
  5. Click OK, then click Apply
  6. Press Win+R
  7. Paste: C : \ Windows \ System32 \ UserAccountControlSettings . exe
  8. Make a note of your current setting
  9. Set notify level to highest level (always notify)
  10. Click OK, then click Yes
  11. Press Win+R
  12. Paste: C : \ Windows \ System32 \ UserAccountControlSettings . exe
  13. Synergy should stay connected when UAC dialog appears
  14. Cancel the UAC dialog
  15. Change your setting back to the original

SRV: synergy-v1.8.3-rc1-e36a7ae-Linux-x86_64
CLN: synergy-v1.8.3-rc1-e36a7ae-Windows-x64

PASSED. Synergy stayed connected.

Retested bug with RC2 for regressions:

SRV: synergy-v1.8.3-rc2-89c9c58-Linux-x86_64
CLN: synergy-v1.8.3-rc2-89c9c58-Windows-x64

Issue #3241

  1. Open GUI on Windows
  2. Ensure client mode is used
  3. Go to Edit->Settings
  4. For Elevate mode, select 'Always'
  5. Click OK, then click Apply
  6. Press Win+R
  7. Paste: C : \ Windows \ System32 \ UserAccountControlSettings . exe
  8. Make a note of your current setting
  9. Set notify level to highest level (always notify)
  10. Click OK, then click Yes
  11. Press Win+R
  12. Paste: C : \ Windows \ System32 \ UserAccountControlSettings . exe
  13. Synergy should stay connected when UAC dialog appears
  14. Cancel the UAC dialog
  15. Change your setting back to the original

PASSED. Synergy stayed connected.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xmstspider picture xmstspider  路  4Comments

jenelcohen picture jenelcohen  路  3Comments

laur89 picture laur89  路  5Comments

straris picture straris  路  5Comments

legonigel picture legonigel  路  4Comments