Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
ffc5c0ee69
!13 [sync] PR-12: Add buildrequires cairo to fix build error
From: @openeuler-sync-bot 
Reviewed-by: @open-bot 
Signed-off-by: @open-bot
2024-04-17 05:26:47 +00:00
zhangxianting
c72a362c85 Add buildrequires cairo to fix build error
(cherry picked from commit e51d615b052e554cef35a90ccb991abb523c911c)
2024-04-17 10:40:38 +08:00
openeuler-ci-bot
3267c7a8c9 !5 [sync] PR-4: Add 2 patch to fix core-dump when start gnome-remote-desktop.service
From: @openeuler-sync-bot
Reviewed-by: @zhang__3125
Signed-off-by: @zhang__3125
2021-09-27 07:37:12 +00:00
dwl301
415163783c Add 2 patch to fix core-dump when start gnome-remote-desktop.service
(cherry picked from commit b289adfe66e14e65f55b2aa837db24a0db4cc81f)
2021-09-27 14:53:24 +08:00
openeuler-ci-bot
8b32e45e44 !3 Upgrade to 0.1.9
From: @weijin-deng
Reviewed-by: @dwl301
Signed-off-by: @dwl301
2021-07-19 06:45:57 +00:00
weijin-deng
4da9c8463e Upgrade to 0.1.9 2021-07-06 18:05:51 +08:00
薄皮小笼包
53d55dbda1 !2 modify url-likexin
Merge pull request !2 from 薄皮小笼包/master
2019-12-31 14:18:09 +08:00
lkx690
7796cdcfa1 modify url 2019-12-30 16:04:49 +08:00
openeuler-ci-bot
34022497d6 !1 gnome-remote-desktop: package init
Merge pull request !1 from daidai_is_here/dqw_test
2019-12-14 16:33:21 +08:00
daidai_is_here
d99743349c package init 2019-12-13 14:46:07 +08:00
5 changed files with 1704 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,71 @@
From 81172effba7c70d3b2932c67be79a2924eae9d73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Mon, 12 Oct 2020 17:34:30 +0200
Subject: [PATCH] vnc: Copy pixels using the right destination stride
We're copying the pixels in a separate thread managed by PipeWire, and
in this thread, accessing the VNC framebuffer dimension and stride is
racy. Instead of fetching the dimension directly, pass the expected
width and get the stride it will eventually have.
Already before this patch, when the copied pixel end up on the main
thread and the dimension still doesn't match up, the frame will be
dropped.
---
src/grd-session-vnc.c | 5 +++--
src/grd-session-vnc.h | 3 ++-
src/grd-vnc-pipewire-stream.c | 5 +++--
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/grd-session-vnc.c b/src/grd-session-vnc.c
index 69fb33d..f4835aa 100644
--- a/src/grd-session-vnc.c
+++ b/src/grd-session-vnc.c
@@ -535,9 +535,10 @@ grd_session_vnc_get_fd (GrdSessionVnc *session_vnc)
}
int
-grd_session_vnc_get_framebuffer_stride (GrdSessionVnc *session_vnc)
+grd_session_vnc_get_stride_for_width (GrdSessionVnc *session_vnc,
+ int width)
{
- return session_vnc->rfb_screen->paddedWidthInBytes;
+ return width * BGRX_BYTES_PER_PIXEL;
}
rfbClientPtr
diff --git a/src/grd-session-vnc.h b/src/grd-session-vnc.h
index 0d01ad3..ccd046c 100644
--- a/src/grd-session-vnc.h
+++ b/src/grd-session-vnc.h
@@ -60,7 +60,8 @@ void grd_session_vnc_move_cursor (GrdSessionVnc *session_vnc,
int grd_session_vnc_get_fd (GrdSessionVnc *session_vnc);
-int grd_session_vnc_get_framebuffer_stride (GrdSessionVnc *session_vnc);
+int grd_session_vnc_get_stride_for_width (GrdSessionVnc *session_vnc,
+ int width);
gboolean grd_session_vnc_is_client_gone (GrdSessionVnc *session_vnc);
diff --git a/src/grd-vnc-pipewire-stream.c b/src/grd-vnc-pipewire-stream.c
index 96dd7c9..82ceb9b 100644
--- a/src/grd-vnc-pipewire-stream.c
+++ b/src/grd-vnc-pipewire-stream.c
@@ -326,10 +326,11 @@ process_buffer (GrdVncPipeWireStream *stream,
int height;
int y;
- src_stride = buffer->datas[0].chunk->stride;
- dst_stride = grd_session_vnc_get_framebuffer_stride (stream->session);
height = stream->spa_format.size.height;
width = stream->spa_format.size.width;
+ src_stride = buffer->datas[0].chunk->stride;
+ dst_stride = grd_session_vnc_get_stride_for_width (stream->session,
+ width);
frame->data = g_malloc (height * dst_stride);
for (y = 0; y < height; y++)
--
2.28.0

View File

@ -0,0 +1,80 @@
From ab97841629f5f3f4fab9993b6255b6ae04828b9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 9 Sep 2020 10:14:20 +0200
Subject: [PATCH] vnc: Drop frames if client is gone
Frames from PipeWire are posted asynchronously from a I/O thread to the
main thread where they are turned into VNC frame updates and cursor
movements. On the other hand, sessions are closed asynchronously when
the VNC client disappears. If a frame ended up on the main thread after
a client disappeared but before the session and stream was closed, we'd
try to turn the new frames into VNC updates without a client being
available, causing use after free.
Fix this by dropping frames that happens during this time frame.
Closes: https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/issues/43
---
src/grd-session-vnc.c | 7 +++++++
src/grd-session-vnc.h | 2 ++
src/grd-vnc-pipewire-stream.c | 8 ++++++++
3 files changed, 17 insertions(+)
diff --git a/src/grd-session-vnc.c b/src/grd-session-vnc.c
index 813838a..a06d34d 100644
--- a/src/grd-session-vnc.c
+++ b/src/grd-session-vnc.c
@@ -209,6 +209,12 @@ maybe_queue_close_session_idle (GrdSessionVnc *session_vnc)
g_idle_add (close_session_idle, session_vnc);
}
+gboolean
+grd_session_vnc_is_client_gone (GrdSessionVnc *session_vnc)
+{
+ return !session_vnc->rfb_client;
+}
+
static void
handle_client_gone (rfbClientPtr rfb_client)
{
@@ -218,6 +224,7 @@ handle_client_gone (rfbClientPtr rfb_client)
grd_session_vnc_detach_source (session_vnc);
maybe_queue_close_session_idle (session_vnc);
+ session_vnc->rfb_client = NULL;
}
static void
diff --git a/src/grd-session-vnc.h b/src/grd-session-vnc.h
index 579a12a..07678c8 100644
--- a/src/grd-session-vnc.h
+++ b/src/grd-session-vnc.h
@@ -57,4 +57,6 @@ void grd_session_vnc_move_cursor (GrdSessionVnc *session_vnc,
int grd_session_vnc_get_framebuffer_stride (GrdSessionVnc *session_vnc);
+gboolean grd_session_vnc_is_client_gone (GrdSessionVnc *session_vnc);
+
#endif /* GRD_SESSION_VNC_H */
diff --git a/src/grd-vnc-pipewire-stream.c b/src/grd-vnc-pipewire-stream.c
index 78793c4..96dd7c9 100644
--- a/src/grd-vnc-pipewire-stream.c
+++ b/src/grd-vnc-pipewire-stream.c
@@ -234,6 +234,14 @@ do_render (struct spa_loop *loop,
if (!frame)
return 0;
+ if (grd_session_vnc_is_client_gone (stream->session))
+ {
+ g_free (frame->data);
+ g_clear_pointer (&frame->rfb_cursor, rfbFreeCursor);
+ g_free (frame);
+ return 0;
+ }
+
if (frame->rfb_cursor)
grd_session_vnc_set_cursor (stream->session, frame->rfb_cursor);
--
2.26.2

Binary file not shown.

62
gnome-remote-desktop.spec Normal file
View File

@ -0,0 +1,62 @@
Name: gnome-remote-desktop
Version: 0.1.9
Release: 3
Summary: Screen share service of GNOME Remote Desktop
License: GPLv2+
URL: https://gitlab.gnome.org/jadahl/gnome-remote-desktop
Source0: https://download.gnome.org/sources/gnome-remote-desktop/0.1/%{name}-%{version}.tar.xz
Patch00001: 0001-vnc-Drop-frames-if-client-is-gone.patch
Patch00002: 0001-vnc-Add-anonymous-TLS-encryption-support.patch
Patch00003: 0001-vnc-Copy-pixels-using-the-right-destination-stride.patch
BuildRequires: meson >= 0.47.0 pkgconfig pkgconfig(glib-2.0) >= 2.32 pkgconfig(gio-unix-2.0) >= 2.32
BuildRequires: pkgconfig(libpipewire-0.3) >= 0.3.0 pkgconfig(libvncserver) >= 0.9.11-7 pkgconfig(libsecret-1)
BuildRequires: pkgconfig(libnotify) pkgconfig(gnutls) systemd pkgconfig(freerdp2) cairo-devel
Requires: pipewire >= 0.3.0
%description
GNOME Remote Desktop is a remote desktop daemon for GNOME using pipewire.
%prep
%autosetup -n %{name}-%{version} -p1
%build
%meson
%meson_build
%install
%meson_install
%post
%systemd_user_post gnome-remote-desktop.service
%preun
%systemd_user_preun gnome-remote-desktop.service
%postun
%systemd_user_postun_with_restart gnome-remote-desktop.service
%files
%doc README COPYING
%{_libexecdir}/gnome-remote-desktop-daemon
%{_datadir}/glib-2.0/schemas/org.gnome.desktop.remote-desktop.{gschema.xml,enums.xml}
%{_userunitdir}/gnome-remote-desktop.service
%changelog
* Wed Apr 17 2024 zhangxianting <zhangxianting@uniontech.com> - 0.1.9-3
- Add buildrequires cairo to fix build error
* Mon Sep 27 2021 Wenlong Ding <wenlong.ding@turbolinux.com.cn> - 0.1.9-2
- Add 2 patch to fix core-dump when start gnome-remote-desktop.service
* Wed Jun 30 2021 weijin deng <weijin.deng@turbolinux.com.cn> - 0.1.9-1
- Upgrade to 0.1.9
- Delete patches whose content existed or target patch file not existed in this version 0.1.9
- Modify 0001-vnc-Add-anonymous-TLS-encryption-support.patch
* Wed Dec 11 2019 daiqianwen <daiqianwen@huawei.com> - 0.1.6-3
- Package init