Age | Commit message (Collapse) | Author | Files | Lines |
|
Add an [Install] section to the user unit and tell systemd to ignore the
.desktop file explicitly.
Also add missing ordering dependencies. Without this, the service fails if
it is started before e.g. $DISPLAY is set.
|
|
To avoid main loop calling it when GIOChannel for x11 was already
destroyed.
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2145004
Signed-off-by: Victor Toso <victortoso@redhat.com>
|
|
/var/run is generally a symlink to /run, which is a tmpfs.
|
|
Signed-off-by: Victor Toso <victortoso@redhat.com>
|
|
Processing events requires some more initialisation between
VDAgentDisplay and vdagent_x11.
Postpone that after initialisation.
This fix a crash on Fedora 36, see
https://bugzilla.redhat.com/show_bug.cgi?id=2042877.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Signed-off-by: Victor Toso <victortoso@redhat.com>
|
|
Adds support for handling the side mouse buttons some mouses have, typically
used in web browsers for previous/next website in history.
spice-gtk requires a corresponding patch to capture and forward the buttons.
At the spice and protocol level, the required changes were previously merged:
* https://gitlab.freedesktop.org/spice/spice/-/issues/45
* https://gitlab.freedesktop.org/spice/spice/-/merge_requests/140
* https://gitlab.freedesktop.org/spice/spice-protocol/-/merge_requests/22
This commit is a rebased and revised version of the patch by Kevin Pouget:
https://www.spinics.net/lists/spice-devel/msg42582.html
(I have confirmed with him that it's OK that I submit the updated patches.)
Co-Authored-By: Kevin Pouget <kpouget@redhat.com>
Co-Authored-By: Joan Bruguera <joanbrugueram@gmail.com>
|
|
This way we can have the log in one place and avoid flooding the journal.
Signed-off-by: Victor Toso <victortoso@redhat.com>
|
|
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2005802
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2028013
Signed-off-by: Victor Toso <victortoso@redhat.com>
|
|
"y" is not "set", but both have non-zero lengths.
|
|
|
|
By default, 'ps' truncates its output to about 100 characters. The
test-termination test depends on finding the socket file name in the
output of the 'ps' command; it could fail depending on the file name
length of the directory where the test was run.
* tests/test-termination.c (get_daemon_pid) <ps>: Invoke with the -ww
option to preserve all the output.
|
|
Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1943059
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Else with dash as /bin/sh, GTK 4 support cannot be selected.
|
|
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
|
|
This can be used to retrieve monitor resolutions directly from the
Mutter compositor under Wayland.
Under environments using a different compositor, the X11 lib will keep
being used.
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
|
|
Adding disabled displays to the list is something that we will need to
do
with multiple backends, not just GTK.
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
|
|
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
|
|
In the container environment, neither systemd nor
console kit is running, thus test-session-info fails.
To fix the pipeline, run "make distcheck" with the
aforementioned option, which disables this test.
Signed-off-by: Jakub Janků <jjanku@redhat.com>
|
|
The test, as it is written at the moment, only makes sense
with console-kit or systemd implementation. With the dummy one,
the test fails, but it's not an error in the vdagent code.
Signed-off-by: Jakub Janků <jjanku@redhat.com>
|
|
The test doesn't depend on udscs.c in common_sources,
for example, so don't include it.
Signed-off-by: Jakub Janků <jjanku@redhat.com>
|
|
The source code refers to "console-kit uid",
but we have console-kit as well as systemd and
dummy implementation of session-info.
Signed-off-by: Jakub Janků <jjanku@redhat.com>
|
|
Test from Uri, integrated in test suite.
Signed-off-by: Uri Lublin <uril@redhat.com>
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Do not allow other users to hijack a session checking that
the process is launched by the owner of the session.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Avoids user hijacking sessions by reusing PID.
In theory an attacker could:
- open a connection to the daemon;
- fork and exit the process but keep the file descriptor open
(inheriting or duplicating it in forked process);
- force OS to recycle the initial PID, by creating many short lived
processes.
Daemon would detect the old PID as having the new session.
Check the user to avoid such replacements.
This issue was reported by SUSE security team.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Limit the number of agents that can be connected.
Avoids reaching the maximum number of files in a process.
Beside one file descriptor per agent the daemon open just some
other fixed number of files.
This issue was reported by SUSE security team.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Limit the number of active file transfers possibly causing DoSes
consuming memory in "active_xfers".
This issue was reported by SUSE security team.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Avoid agents allocating file transfers.
The "active_xfers" entries are now inserted when client start sending
files.
Also different agents cannot mess with other agent transfers as a
transfer is bound to a single agent.
This issue was reported by SUSE security team.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Create the socket with the right permissions using umask.
This also prevents possible symlink exploitation in case socket
path is not secure.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
In vdagent_x11_destroy(), only x11->randr.failed_conf is freed
and x11->randr.{res, outputs, crtcs} are left allocated.
To fix it, create a new function vdagent_x11_randr_destroy()
that frees all randr resources, and call it from vdagent_x11_destroy().
Signed-off-by: Jakub Janků <jjanku@redhat.com>
|
|
With latest fedora container using F33, we get gtk4 3.99, where vulkan is
enabled by default.
This require to get the vulkan headers as a dependency.
Signed-off-by: Julien Ropé <jrope@redhat.com>
|
|
The GUINT32_TO_LE in case of big endian machine can expand
the argument multiple times so avoid to pass argument that
could have side effects.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@redhat.com>
|
|
g_free does nothing if pointer is NULL.
device_info and device_info_size will be overwritten in any case.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@redhat.com>
|
|
The array is not supposed to be changed.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@redhat.com>
|
|
X11 events are still used to notify the daemon of monitor resolution
changes, but the X11 structures themselves do not need to be updated,
because we will get all required informations from the GTK library.
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
Since vdagent_x11_set_monitor_config() can work only under the X11
backend, make sure we don't call it when under Wayland - it will fail
anyway.
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
- Implement the vdagent_gtk_get_resolutions() function.
Use gdk_monitor_*() functions to retrieve the resolution of each
monitor. Associate them to the right display ID using the
connector_mapping hash
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
some of it with different backends.
Most display drivers will number their outputs starting with "1", but
some (like older QXL drivers) will start from 0.
As we need to map device names with SPICE display IDs, we need to know
what to expect.
The logic that finds whether we have a O-based index or not is
independent from the backend, and can be reused outside of the X11
implementation.
This commit separates this logic for that purpose, to prevent code
duplication.
- create the has_zero_based_display_id() function to call whatever the
backend, and learn whether our IDs should be decremented or not.
Its code is taken out of lookup_xrandr_output_for_device_info()
- keep the lookup_xrandr_output_for_device_info() for x11 implementation
- add parameters to some functions to give them the information that IDs
should be decremented because of the 0-based index.
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
Split the lookup_xrandr_output_for_device_info to access the part
retrieving the expected connector name.
Call that separate function in the "non-X11" part of the code, and use a
hashtable to map Spice display ID to its expected connector name.
This hashtable will later be used when we need to report resolution
changes to the daemon/server.
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
structure.
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
daemon/server.
The purpose here is to further separate X11-specific code, and have the
actual sending to the daemon to be out of X11 code, and reusable by
other APIs.
- Replace vdagent_x11_send_daemon_guest_res() with a function that
builds
and returns the list of monitor resolutions.
- Create the vdagent_display_send_daemon_guest_res() that uses this to
send the resolutions to the daemon.
- Call this function in place of vdagent_x11_send_daemon_guest_res()
In later commits, we will be able to use a different API to generate
the list of monitor resolution, without having to change the X11 code.
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
Allows to see tests results in case "make check" fails.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
|
|
When the user wants to copy files, new spice-gtk can share those
files using the existing phodav server. In that case, it advertises
the VD_AGENT_CLIPBOARD_FILE_LIST type in the clipboard grab message.
Upon request of the clipboard data in the mentioned type, spice-gtk
provides a list of absolute paths in the phodav server - these are
the files that are supposed to be copied/moved.
The role of the vdagent is to:
1) ensure that the phodav share is mounted,
2) adjust the provided paths given the mountpoint,
3) provide the uri list in various formats depending on which one
was requested (different file managers use differenct formats)
The code that accomplishes these tasks is located in a new file
webdav-cb.c - the main reason for it is that vdagent currently
supports two clibpoard backends: x11, gtk+.
Implement this new feature only in the x11 backend since
the future of the gtk+ one is not clear.
Copy and move was tested with GNOME Nautilus, KDE Dolphin,
Cinnamon Nemo, Mate Caja, Xfce Thunar, LXDE PCManFM, Krusader.
The functionality with other file managers might be limited.
Copying files from the vdagnet side to the client is not
supported yet.
Signed-off-by: Jakub Janků <jjanku@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
This adds the VD_AGENT_CLIPBOARD_FILE_LIST
necessary for the following commits.
Signed-off-by: Jakub Janků <jjanku@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
With the upcoming patch, clipboard data will be sent to the
requestor outside of vdagent_x11_clipboard_data() so
extract the necessary code into a new function to avoid
repetition.
The function takes "take_ownership" argument. If set to True,
the caller doesn't have to free the passed data which will
also be useful with the following changes.
Improve style by adding brackets to single-line if statements.
Signed-off-by: Jakub Janků <jjanku@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
Use XX% instead of %XX.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
|