Hello community, here is the log from the commit of package spice-vdagent for openSUSE:Leap:15.2 checked in at 2020-01-31 17:19:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/spice-vdagent (Old) and /work/SRC/openSUSE:Leap:15.2/.spice-vdagent.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "spice-vdagent" Fri Jan 31 17:19:37 2020 rev:16 rq:758326 version:0.19.0 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/spice-vdagent/spice-vdagent.changes 2020-01-15 16:03:44.103935466 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.spice-vdagent.new.26092/spice-vdagent.changes 2020-01-31 17:19:38.124494924 +0100 @@ -1,0 +2,56 @@ +Tue Dec 17 16:51:54 UTC 2019 - Bruce Rogers <brogers@suse.com> + +- Since the 0.19.0 update, this patch is no longer needed: + spice-vdagent-var_run.patch +- For sometime now we've not had any rsyslog config files, so clean + up where the spec file would remove the rsyslog.d dir and content + +------------------------------------------------------------------- +Wed Dec 11 17:33:36 UTC 2019 - Bruce Rogers <brogers@suse.com> + +- Add upstream fix for spice-vdagent running on recent GNOME (eg. + 3.34) with systemd integration (boo#1157235) + vdagentd-Fix-session-lookup-for-new-GNOME-versions.patch + +------------------------------------------------------------------- +Fri May 17 20:34:45 UTC 2019 - Bruce Rogers <brogers@suse.com> + +- Update to 0.19.0 + * Add libdrm dependency + * Fix file descriptor leak on failed connections + * Handle new VD_AGENT_GRAPHICS_DEVICE_INFO message advertised by + VD_AGENT_CAP_GRAPHICS_DEVICE_INFO capability + * Session agent autostart changed to WindowManager ([rhbz#1623947]) + This fixes possible race with xdg-user-dirs + * Fix of sending empty screen resolution messages ([rhbz#1641723]) + * Fix 'Dependency failed for Activation socket' with systemd ([rhbz#1545212]) + * Fix error messages about on selecting text on host ([rhbz#1594876]) + this was also fixed with Gtk backend + * Update paths from /var/run → /run + * Fix Session agent restart + * Add test for file creation + * Prefer GLib memory functions stdlib.h ones + * Several code and logs improvements + * Add GTK+ framework to handle x11 backend such as clipboard + * Deprecate X11 backend in favor of GTK+ framework + * Ask pkg-config to appropriate directory to install udev rules + * Fix leak of udscs's file descriptor + * Better quote directory path when calling xdg-open to save file transfer + * Bump GLib to 2.34 + * Add systemd socket activation (rhbz#1340160) + * Add support to detailed errors on file transfers + * Add check for available free space in guest before starting a file transfer + * Use better names for duplicated files on file transfer + * Improve support on big endian guests (#5) + * Use IdleHint to check if a session is locked over console-kit (rhbz#1412673) + * Fixes double free on errors over udscs by improving memory ownership + * Hide autostart file on Unity + * Improve command line messages for vdagentd + * Fix typo in --enable-static-uinput configure option + * Code repository moved to gitlab.freedesktop.org +- Add keyring and tarball signature files +- obsoleted patches removed: + 8ba17481-quote-save-dir-before-passing-to-shell.patch + vdagentd-do-endian-swapping.patch + +------------------------------------------------------------------- Old: ---- 8ba17481-quote-save-dir-before-passing-to-shell.patch spice-vdagent-0.17.0.tar.bz2 spice-vdagent-var_run.patch vdagentd-do-endian-swapping.patch New: ---- spice-vdagent-0.19.0.tar.bz2 spice-vdagent-0.19.0.tar.bz2.sig spice-vdagent.keyring vdagentd-Fix-session-lookup-for-new-GNOME-versions.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ spice-vdagent.spec ++++++ --- /var/tmp/diff_new_pack.G1phvL/_old 2020-01-31 17:19:38.648495207 +0100 +++ /var/tmp/diff_new_pack.G1phvL/_new 2020-01-31 17:19:38.652495210 +0100 @@ -1,7 +1,7 @@ # # spec file for package spice-vdagent # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # Copyright (c) 2014 B1 Systems GmbH, Vohburg, Germany. # # All modifications and additions to the file contributed by third parties @@ -13,34 +13,36 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: spice-vdagent -Version: 0.17.0 +Version: 0.19.0 Release: 0 Summary: Agent for Spice guests -License: GPL-3.0+ -Group: Applications/System -Url: http://spice-space.org/ -Source0: http://spice-space.org/download/releases/%{name}-%{version}.tar.bz2 -Patch0: spice-vdagent-var_run.patch -Patch1: vdagentd-do-endian-swapping.patch -Patch2: 8ba17481-quote-save-dir-before-passing-to-shell.patch +License: GPL-3.0-or-later +Group: System/Daemons +URL: http://spice-space.org/ +Source: http://spice-space.org/download/releases/%{name}-%{version}.tar.bz2 +Source1: http://spice-space.org/download/releases/%{name}-%{version}.tar.bz2.sig +Source2: %{name}.keyring +Patch0: vdagentd-Fix-session-lookup-for-new-GNOME-versions.patch BuildRequires: alsa-devel >= 1.0.22 BuildRequires: desktop-file-utils BuildRequires: glib2-devel BuildRequires: libXfixes-devel BuildRequires: libXinerama-devel BuildRequires: libXrandr-devel +BuildRequires: libdrm-devel BuildRequires: libpciaccess-devel BuildRequires: libtool BuildRequires: spice-protocol-devel >= 0.12.8 BuildRequires: systemd BuildRequires: systemd-devel BuildRequires: pkgconfig(dbus-1) -BuildRequires: pkgconfig(glib-2.0) >= 2.28 +BuildRequires: pkgconfig(glib-2.0) >= 2.34 +BuildRequires: pkgconfig(udev) Supplements: modalias(xorg-x11-server:virtio:d00000003v*) %{?systemd_requires} @@ -59,8 +61,6 @@ %prep %setup -q %patch0 -p1 -%patch1 -p1 -%patch2 -p1 %build %configure \ @@ -70,11 +70,6 @@ %install make install DESTDIR=%{buildroot} V=2 -# move udev role -mv %{buildroot}/lib/udev %{buildroot}%{_prefix}/lib -rmdir %{buildroot}/lib -# remove rsyslogd config -rm -rf %{buildroot}%{_sysconfdir}/rsyslog.d # create rc symlink ln -s service %{buildroot}%{_sbindir}/rcspice-vdagentd @@ -85,32 +80,34 @@ %pre %service_add_pre spice-vdagentd.service -%service_add_pre spice-vdagentd.target +%service_add_pre spice-vdagentd.socket %post %service_add_post spice-vdagentd.service if [ "$1" -eq 1 ]; then systemctl -q enable spice-vdagentd.service || : fi -%service_add_post spice-vdagentd.target +%service_add_post spice-vdagentd.socket %tmpfiles_create %_tmpfilesdir/spice-vdagentd.conf %preun %service_del_preun spice-vdagentd.service -%service_del_preun spice-vdagentd.target +%service_del_preun spice-vdagentd.socket %postun %service_del_postun spice-vdagentd.service -%service_del_postun spice-vdagentd.target +%service_del_postun spice-vdagentd.socket %files %defattr(-,root,root) -%doc COPYING ChangeLog README TODO +%doc CHANGELOG.md README.md +%license COPYING %dir %{_libexecdir}/udev %dir %{_libexecdir}/udev/rules.d +%ghost /run/spice-vdagentd %{_libexecdir}/udev/rules.d/70-spice-vdagentd.rules %{_unitdir}/spice-vdagentd.service -%{_unitdir}/spice-vdagentd.target +%{_unitdir}/spice-vdagentd.socket %{_libexecdir}/tmpfiles.d/spice-vdagentd.conf %{_bindir}/spice-vdagent %{_sbindir}/spice-vdagentd ++++++ spice-vdagent-0.17.0.tar.bz2 -> spice-vdagent-0.19.0.tar.bz2 ++++++ ++++ 20864 lines of diff (skipped) ++++++ vdagentd-Fix-session-lookup-for-new-GNOME-versions.patch ++++++
From b67ff71f1b30992f5b8d4583cc93adb789d247fa Mon Sep 17 00:00:00 2001 From: Benjamin Berg <bberg@redhat.com> Date: Fri, 13 Sep 2019 17:00:27 +0200 Subject: [PATCH] vdagentd: Fix session lookup for new GNOME versions
New GNOME versions have started to manage the session using the systemd user instance. The effect of this is that the spice-vdagent running in the user session is forked off (indirectly) from the systemd user instance and does technically not belong to any session. The correct way of handling this situation is to simply assume that the process belongs to the users graphical session. Add a heuristic to find the graphical session based on the UID, fixing spice-vdagent running on GNOME 3.34 with systemd integration. Acked-by: Victor Toso <victortoso@redhat.com> [BR: boo#1157235] Signed-off-by: Bruce Rogers <brogers@suse.com> --- src/vdagentd/systemd-login.c | 59 +++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/src/vdagentd/systemd-login.c b/src/vdagentd/systemd-login.c index a11b66d..0b8f3c1 100644 --- a/src/vdagentd/systemd-login.c +++ b/src/vdagentd/systemd-login.c @@ -286,15 +286,66 @@ const char *session_info_get_active_session(struct session_info *si) char *session_info_session_for_pid(struct session_info *si, uint32_t pid) { + int i; int r; + GStrv sessions = NULL; char *session = NULL; + uid_t uid; r = sd_pid_get_session(pid, &session); - if (r < 0) - syslog(LOG_ERR, "Error getting session for pid %u: %s", - pid, strerror(-r)); - else if (si->verbose) + if (r >= 0) { + goto out; + } + + /* If we could not get a session for the pid then the agent is probably + * running in a systemd managed session. In that case we simply assume + * it is actually part of the newest graphical session we can find. */ + r = sd_pid_get_owner_uid(pid, &uid); + if (r < 0) { + syslog(LOG_ERR, "Error getting owner UID for pid %u: %s", + pid, strerror(-r)); + goto out; + } + + r = sd_uid_get_sessions(uid, 0, &sessions); + if (r < 0) { + syslog(LOG_ERR, "Error getting sessions for UID %d: %s", + (int) uid, strerror(-r)); + goto out; + } + + for (i = 0; sessions[i] != NULL; i++) { + char *session_type = NULL; + + r = sd_session_get_type(sessions[i], &session_type); + + if (r < 0) { + syslog(LOG_ERR, "Error getting session type for session %s: %s", + sessions[i], strerror(-r)); + continue; + } + + if (g_strcmp0(session_type, "wayland") == 0 || + g_strcmp0(session_type, "x11") == 0 || + g_strcmp0(session_type, "mir") == 0) { + + /* We prefer the newest session (i.e. last entry) from the + * user, assuming that any old session that still exist has + * just not yet died properly. */ + if (session != NULL) + free (session); + session = g_strdup(sessions[i]); + } + + free(session_type); + } + + g_strfreev(sessions); + +out: + if (session != NULL && si->verbose) { syslog(LOG_INFO, "Session for pid %u: %s", pid, session); + } return session; } -- 2.24.0