Rebase patches so all apply, backport crasher fix (#1882718)
parent
ef4793207b
commit
5cf3fbdaab
@ -1,47 +0,0 @@
|
|||||||
From 42815c7a5672edb16ab810378b7c34b3e8e74832 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
|
|
||||||
Date: Wed, 27 Nov 2019 16:58:29 +0100
|
|
||||||
Subject: [PATCH 3/3] auth: Add API to unregister built in security handlers
|
|
||||||
|
|
||||||
If I have a VNC server that first accepts password based authentication,
|
|
||||||
then switches to something not using password (e.g. a prompt on screen),
|
|
||||||
the security handler from the first would still be sent as, meaning
|
|
||||||
clients would still ask for a password without there being one.
|
|
||||||
---
|
|
||||||
libvncserver/auth.c | 7 +++++++
|
|
||||||
rfb/rfb.h | 1 +
|
|
||||||
2 files changed, 8 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/libvncserver/auth.c b/libvncserver/auth.c
|
|
||||||
index fc74c800..94b46fd6 100644
|
|
||||||
--- a/libvncserver/auth.c
|
|
||||||
+++ b/libvncserver/auth.c
|
|
||||||
@@ -248,6 +248,13 @@ determinePrimarySecurityType(rfbClientPtr cl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+void
|
|
||||||
+rfbUnregisterPrimarySecurityHandlers (void)
|
|
||||||
+{
|
|
||||||
+ rfbUnregisterSecurityHandler(&VncSecurityHandlerNone);
|
|
||||||
+ rfbUnregisterSecurityHandler(&VncSecurityHandlerVncAuth);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void
|
|
||||||
rfbSendSecurityTypeList(rfbClientPtr cl,
|
|
||||||
enum rfbSecurityTag exclude)
|
|
||||||
diff --git a/rfb/rfb.h b/rfb/rfb.h
|
|
||||||
index f56bd47d..d1763c6c 100644
|
|
||||||
--- a/rfb/rfb.h
|
|
||||||
+++ b/rfb/rfb.h
|
|
||||||
@@ -856,6 +856,7 @@ extern void rfbUnregisterSecurityHandler(rfbSecurityHandler* handler);
|
|
||||||
extern void rfbRegisterChannelSecurityHandler(rfbSecurityHandler* handler);
|
|
||||||
extern void rfbUnregisterChannelSecurityHandler(rfbSecurityHandler* handler);
|
|
||||||
extern void rfbSendSecurityTypeList(rfbClientPtr cl, enum rfbSecurityTag exclude);
|
|
||||||
+extern void rfbUnregisterPrimarySecurityHandlers (void);
|
|
||||||
|
|
||||||
/* rre.c */
|
|
||||||
|
|
||||||
--
|
|
||||||
2.26.2
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
|||||||
|
From 2a77dd86a97fa5f4735f678599cea839ba09009c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Christian Beier <info@christianbeier.net>
|
||||||
|
Date: Sun, 9 Aug 2020 20:11:26 +0200
|
||||||
|
Subject: [PATCH 3/4] libvncserver/auth: don't keep security handlers from
|
||||||
|
previous runs
|
||||||
|
|
||||||
|
Whyohsoever security handlers are stored in a variable global to the
|
||||||
|
application, not in the rfbScreen struct. This meant that security
|
||||||
|
handlers registered once would stick around forever before this commit.
|
||||||
|
---
|
||||||
|
libvncserver/auth.c | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libvncserver/auth.c b/libvncserver/auth.c
|
||||||
|
index 55e0b3c9..fc74c800 100644
|
||||||
|
--- a/libvncserver/auth.c
|
||||||
|
+++ b/libvncserver/auth.c
|
||||||
|
@@ -264,9 +264,11 @@ rfbSendSecurityTypeList(rfbClientPtr cl,
|
||||||
|
primaryType = determinePrimarySecurityType(cl);
|
||||||
|
switch (primaryType) {
|
||||||
|
case rfbSecTypeNone:
|
||||||
|
+ rfbUnregisterSecurityHandler(&VncSecurityHandlerVncAuth);
|
||||||
|
rfbRegisterSecurityHandler(&VncSecurityHandlerNone);
|
||||||
|
break;
|
||||||
|
case rfbSecTypeVncAuth:
|
||||||
|
+ rfbUnregisterSecurityHandler(&VncSecurityHandlerNone);
|
||||||
|
rfbRegisterSecurityHandler(&VncSecurityHandlerVncAuth);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
@ -0,0 +1,45 @@
|
|||||||
|
From 641610b961a732bb68f111536ebf8c42be20f05b Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
|
||||||
|
Date: Wed, 16 Sep 2020 17:35:49 +0200
|
||||||
|
Subject: [PATCH 4/4] zlib: Clear buffer pointers on cleanup (#444)
|
||||||
|
|
||||||
|
The pointers to the buffers were freed, and the size fields were set to
|
||||||
|
0, but the buffer pointers themsef was not set to NULL, when shutting
|
||||||
|
down, meaning the next time used, NULL checks would not tell whether the
|
||||||
|
pointer is valid. This caused crashes ending with
|
||||||
|
|
||||||
|
#0 0x00007ffff73729e5 in raise () from /lib64/libc.so.6
|
||||||
|
#1 0x00007ffff735b895 in abort () from /lib64/libc.so.6
|
||||||
|
#2 0x00007ffff73b6857 in __libc_message () from /lib64/libc.so.6
|
||||||
|
#3 0x00007ffff73bdd7c in malloc_printerr () from /lib64/libc.so.6
|
||||||
|
#4 0x00007ffff73c2f1a in realloc () from /lib64/libc.so.6
|
||||||
|
#5 0x00007ffff78b558e in rfbSendOneRectEncodingZlib (cl=0x4a4b80, x=0, y=0, w=800, h=40) at /home/jonas/Dev/gnome/libvncserver/libvncserver/zlib.c:106
|
||||||
|
#6 0x00007ffff78b5dec in rfbSendRectEncodingZlib (cl=0x4a4b80, x=0, y=0, w=800, h=600) at /home/jonas/Dev/gnome/libvncserver/libvncserver/zlib.c:308
|
||||||
|
#7 0x00007ffff7899453 in rfbSendFramebufferUpdate (cl=0x4a4b80, givenUpdateRegion=0x49ef70) at /home/jonas/Dev/gnome/libvncserver/libvncserver/rfbserver.c:3264
|
||||||
|
#8 0x00007ffff789079d in rfbUpdateClient (cl=0x4a4b80) at /home/jonas/Dev/gnome/libvncserver/libvncserver/main.c:1275
|
||||||
|
#9 0x00007ffff78905f5 in rfbProcessEvents (screen=0x4d5790, usec=0) at /home/jonas/Dev/gnome/libvncserver/libvncserver/main.c:1251
|
||||||
|
---
|
||||||
|
libvncserver/zlib.c | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libvncserver/zlib.c b/libvncserver/zlib.c
|
||||||
|
index d24d7d15..5c3a8236 100644
|
||||||
|
--- a/libvncserver/zlib.c
|
||||||
|
+++ b/libvncserver/zlib.c
|
||||||
|
@@ -64,11 +64,13 @@ void rfbZlibCleanup(rfbScreenInfoPtr screen)
|
||||||
|
{
|
||||||
|
if (zlibBeforeBufSize) {
|
||||||
|
free(zlibBeforeBuf);
|
||||||
|
+ zlibBeforeBuf = NULL;
|
||||||
|
zlibBeforeBufSize=0;
|
||||||
|
}
|
||||||
|
if (zlibAfterBufSize) {
|
||||||
|
zlibAfterBufSize=0;
|
||||||
|
free(zlibAfterBuf);
|
||||||
|
+ zlibAfterBuf = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
Loading…
Reference in new issue