48 lines
1.6 KiB
Diff
48 lines
1.6 KiB
Diff
From 23526b25b9a8088c7435563516bea96ed4408c13 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
|
|
Date: Wed, 27 Nov 2019 16:53:42 +0100
|
|
Subject: [PATCH] vnc: Unregister previously set security handlers on init
|
|
|
|
When we're starting a session, we're going to handle a new client
|
|
connection. However, any previous client that was ever run on in a
|
|
previous session would still have their "security handler" registered,
|
|
as such is a global permanent change in libvncserver right now.
|
|
|
|
To work around this, unregister all primary security handler (i.e.
|
|
'none' and 'password') when initializing the RFB screen. We'll set up
|
|
the preferred one when handling the new client.
|
|
---
|
|
src/grd-session-vnc.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/src/grd-session-vnc.c b/src/grd-session-vnc.c
|
|
index c5f83d8..2967415 100644
|
|
--- a/src/grd-session-vnc.c
|
|
+++ b/src/grd-session-vnc.c
|
|
@@ -28,6 +28,9 @@
|
|
#include <linux/input.h>
|
|
#include <rfb/rfb.h>
|
|
|
|
+/* Potential redeclaration of libVNCServer API to avoid build failure. */
|
|
+extern void rfbUnregisterPrimarySecurityHandlers (void);
|
|
+
|
|
#include "grd-context.h"
|
|
#include "grd-prompt.h"
|
|
#include "grd-settings.h"
|
|
@@ -564,6 +567,12 @@ init_vnc_session (GrdSessionVnc *session_vnc)
|
|
8, 3, 4);
|
|
session_vnc->rfb_screen = rfb_screen;
|
|
|
|
+ /*
|
|
+ * Unregister whatever security handler was used the last time; we'll set
|
|
+ * up new ones when authorizing the new client anyway.
|
|
+ */
|
|
+ rfbUnregisterPrimarySecurityHandlers ();
|
|
+
|
|
update_server_format (session_vnc);
|
|
|
|
socket = g_socket_connection_get_socket (session_vnc->connection);
|
|
--
|
|
2.23.0
|
|
|