summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-09-30buildsys: statis typo in configure optionHEADmasterVictor Toso1-1/+1
Acked-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-30build-sys: remove prefix from filenamesVictor Toso18-37/+43
Acked-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-30build-sys: move user/system to respective dirMarc-André Lureau21-26/+31
Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-30build-sys: get rid of noinst_HEADERSMarc-André Lureau1-14/+12
Regular headers file should be listed in SOURCES Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-30build-sys: reformat Makefile.amVictor Toso1-31/+67
Makes the makefile more readable and easy to change in the next few commits. Based on Marc-André Lureau patch. Acked-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-06-10prepare to v0.17.0Victor Toso2-1/+16
2016-06-03systemd-login: check for LockedHint propertyVictor Toso1-10/+98
Property introduced in v230 of systemd. Systems that don't have up to date systemd-login will get the following log message: "Properties.Get failed (locked-hint) due Unknown property or interface." Resolves: rhbz#1323623 Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-04console-kit: implement check for session typeVictor Toso1-2/+67
Implementing the function that was introduced in previous commit: session_info_is_user() In console-kit we can gather the session type with GetSessionType api from Session interface. This function is not well documented but seems reliable enough as GDM was using it [0] [0] session_is_login_window on gui/simple-greeter/gdm-user-manager.c Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1323640 Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-04session-info: check if session belongs to userVictor Toso8-0/+58
session-info back-ends such as console-kit and systemd-login have the concept of session's class which informs if session belongs to user or not [0]. We can disable features based on the session class. [0] Display-Managers are 'Greeter' and Display lock screens are 'lock-screen' This patch introduces session_info_is_user() and disable file-xfer in case agent's session does not belong to the 'user' class. As the session-info data is hold by vdagentd, this patch also introduces VDAGENTD_FILE_XFER_DISABLE message to disable file-xfer that is done in vdagent. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1328761 Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-04console-kit: implement check for locked sessionVictor Toso1-3/+85
We register to read the Lock, Unlock and IdleHintChanged signals from ConsoleKit.Session. The Lock/Unlock signals should be the right signals for the job but not all Desktop Managers implement its locking in a way that trigger those signals. That's why we double-check with IdleHintChanged signal that it might be triggered by other services like screen savers. Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-04session-info: check for a locked sessionVictor Toso6-13/+153
Each session back-end can return this information to vdagentd when requested. The agent should use this on situations that should not work when session is locked such as file-transfer-start which is fixed by this patch. systemd-login is the only back-end implementing this function at the moment and I'll address console-kit back-end in a later patch. Also, this patch makes spice-vdagent depend on dbus for getting the lock information. Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1323623 Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-04console-kit: fix dangling pointerVictor Toso1-0/+1
Introduced recently by b1b8b71961b9a28cc4896e9973d3a3c1975ead39 Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-04console-kit: Ignore unrequested messages from dbusVictor Toso1-8/+6
Instead of treating them as errors. Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-04vdagentd: send file-xfer status, generic versionVictor Toso1-7/+11
Change cancel_file_xfer() helper function to file_xfer_status() so we can send other status to the client. Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-04-28console-kit: include handler for dbus matchVictor Toso1-14/+52
At the moment we request to read signals on ConsoleKit.Seat interface but later on we will request to read signals on different interface so moving this to its own function helps. Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-04-28console-kit: include signal handler functionVictor Toso1-54/+58
At the moment we are only reading the ActiveSessionChanged signal from ConsoleKit.Seat but in a later patch we will be reading a few more signals so it make sense to move this handler to its own function. Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-04-28console-kit: do not use empty sessionVictor Toso1-1/+6
DBus might return empty string for active-session, probably in a non user session (e.g. gdm). It is better to keep the variable as NULL as we check against that (but never against empty strings). Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-04-28console-kit: save verbosity level for debuggingVictor Toso1-0/+7
Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-04-28console-kit: use standard name for session-info varVictor Toso1-47/+47
Console-kit was the first back-end implement to gather session info. When systemd integration was implemented with logind, we introduced session-info struct to deal with different back-ends. The 'ck' var was not changed at the time but it seems right to do so. Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-04-28console-kit: use define for dbus pathsVictor Toso1-10/+20
This improves readability of all paths related to dbus methods. This patch only applies for interfaces and object paths, later one it is included for signals as well. Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-04-11remove trailing spacesVictor Toso21-69/+69
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-04-11Bump glib to 2.28Victor Toso4-47/+2
Removing glib-compat header as it isn't used anymore.
2016-03-01buildsys: Support libsystemd in addition to libsystemd-loginChristophe Fergeau1-1/+8
Since systemd 209, the various systemd helper libraries are gathered in a single libsystemd, and libsystemd-login is only built when systemd is built with compat libraries support. Since commit https://github.com/systemd/systemd/commit/4de282c "build-sys: drop libsystemd-{id128,daemon,login,journal}.so compat libs" (2016-02-12), these compat libraries are no longer available. This commit checks for both libsystemd and libsystemd-login to ensure we can build on both older and newer systemd versions. https://bugs.freedesktop.org/show_bug.cgi?id=94209
2016-01-05vdagent: Mark vdagent and vdagentd functions staticFrancois Gouget3-15/+15
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-11-13vdagent: Disable the server-side udscs code for vdagentFrancois Gouget1-1/+1
vdagent only needs the client-side API. Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-11-13vdagent: Allow disabling the server-side udscs supportFrancois Gouget1-1/+7
To do so define UDSCS_NO_SERVER. This simplifies reuse in client-only scenarios that don't need peer credential support for instance. Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-11-13vdagent: Group the client and server functions togetherFrancois Gouget2-292/+314
This will simplify selectively disabling the server-side code. Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-11-13vdagent: VDP_LAST_PORT is redundant with VDP_END_PORT. Remove itFrancois Gouget1-5/+4
VDP_LAST_PORT is equal to VDP_SERVER_PORT while VDP_END_PORT (defined in spice-protocol) is VDP_SERVER_PORT + 1 so the code needs to be adjusted to account for this difference. Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-09-15vdagent: Return '1' when virtio device cannot be openedChristophe Fergeau1-1/+2
The vdagent process currently exits with an error code set to 0 whenn the virtio device cannot be opened (for example because it's missing). This is not consistent with the other failures to startup which set the exit code to 1. This commit ensures 1 is returned in this situation too. Resolves: rhbz#1256704
2015-09-15vdagentd: fixes small leakVictor Toso1-0/+1
This correctly fixes the leak from reverted patch 4835df0b642dfc963e7 ==2648== HEAP SUMMARY: ==2648== in use at exit: 104,699 bytes in 1,459 blocks ==2648== total heap usage: 14,177 allocs, 12,718 frees, 1,190,456 bytes allocated ==2648== ==2648== 16 bytes in 1 blocks are definitely lost in loss record 16 of 130 ==2648== at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==2648== by 0x10B530: agent_read_complete (vdagentd.c:715) ==2648== by 0x10E8DC: udscs_read_complete (udscs.c:460) ==2648== by 0x10EAFC: udscs_do_read (udscs.c:515) ==2648== by 0x10E490: udscs_client_handle_fds (udscs.c:349) ==2648== by 0x10E402: udscs_server_handle_fds (udscs.c:337) ==2648== by 0x10BAB1: main_loop (vdagentd.c:844) ==2648== by 0x10A3E6: main (vdagentd.c:974) ==2648== ==2648== LEAK SUMMARY: ==2648== definitely lost: 16 bytes in 1 blocks ==2648== indirectly lost: 0 bytes in 0 blocks ==2648== possibly lost: 41,483 bytes in 1,268 blocks ==2648== still reachable: 63,200 bytes in 190 blocks ==2648== suppressed: 0 bytes in 0 blocks ==2648== Reachable blocks (those to which a pointer was found) are not shown. ==2648== To see them, rerun with: --leak-check=full --show-leak-kinds=all
2015-09-15Revert "uinput: fix small leak of screen_info"Victor Toso1-4/+0
This reverts commit 4835df0b642dfc963e7cbaabfe93da86482f0b93. uinput only holds reference to screen_info and should not free it. The leak should be fixed somewhere else. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1262635
2015-06-30Prepare for 0.16.0 releaseChristophe Fergeau3-1/+12
2015-06-17Add -fno-strict-aliasing to default CFLAGSChristophe Fergeau1-1/+1
Compilation breaks with older gcc versions (gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) on RHEL6) with the following error (due to the additional use of -Werror in the default CFLAGS) CC src/src_spice_vdagent-vdagent-x11-randr.o cc1: warnings being treated as errors src/vdagent-x11-randr.c: In function ‘vdagent_x11_randr_handle_event’: src/vdagent-x11-randr.c:499: error: dereferencing pointer ‘sce’ does break strict-aliasing rules src/vdagent-x11-randr.c:499: error: dereferencing pointer ‘sce’ does break strict-aliasing rules src/vdagent-x11-randr.c:498: note: initialized from here make: *** [src/src_spice_vdagent-vdagent-x11-randr.o] Error 1 Strict aliasing is not something we must have for the agent, and the alternative would most likely involve an anonymous union, or some casting. Given that this warning only occurs with these older compilers, better to go with a fix as non-invasive as possible. Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=90981
2015-06-01man: vdagentd: document -f (fake) and -o (once) command line optionsUri Lublin1-0/+7
Added by commits: 251637aa23 and 1c25f882a
2015-05-27Bump minimum spice-protocol versionChristophe Fergeau1-1/+1
spice-protocol newer than 0.12.7 is needed for the volume synchronization bits.
2015-04-29vdagentd-proto-strings: Add missing string for VDAGENTD_AUDIO_VOLUME_SYNCPavel Grunt1-0/+1
Avoids a crash when running spice-vdagent with debug Backtrace: #0 0x0000003dcf647e2c in _IO_vfprintf_internal (s=<value optimized out>, format=<value optimized out>, ap=<value optimized out>) at vfprintf.c:1641 #1 0x0000003dcf6e4e90 in __vsyslog_chk (pri=<value optimized out>, flag=-1, fmt=0x40f360 "%p received %s, arg1: %u, arg2: %u, size %u", ap=0x7fffffffddc0) at ../misc/syslog.c:222 #2 0x0000003dcf6e50c0 in __syslog (pri=<value optimized out>, fmt=<value optimized out>) at ../misc/syslog.c:119 #3 0x000000000040c6da in udscs_read_complete (connp=0x610de8) at src/udscs.c:448 #4 0x000000000040c8d1 in udscs_do_read (connp=0x610de8) at src/udscs.c:500 #5 0x000000000040c303 in udscs_client_handle_fds (connp=0x610de8, readfds=0x7fffffffe0a0, writefds=0x7fffffffe020) at src/udscs.c:349 #6 0x0000000000403d74 in main (argc=3, argv=0x7fffffffe248) at src/vdagent.c:365
2015-04-24vdagent: volume synchronization from client.Victor Toso3-0/+33
Include the capability of volume sync to set volume or mute to default sink-input/source-output of guest.
2015-04-24audio: add functions to set volume/mute with alsaVictor Toso4-3/+205
This patch includes the vdagent-audio.[ch] files in order to communicate with backend audio server. The two functions provide a way to set volume and mute in the guest by connecting to default mixer control in alsa which is 'Master' for playback and 'Capture' for record.
2015-04-12Fix implicit declaration of 'g_unlink' (warning)Fabiano Fidêncio1-0/+1
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1086657
2015-04-10randr: handle XRRScreenChangeNotifyEventMarc-Andre Lureau3-3/+39
Make sure vdagent follows the current monitor configuration. This solves a number of issue where the pointer input is off, because the uinput tablet isn't reconfigured. https://bugzilla.redhat.com/show_bug.cgi?id=1086657
2015-04-10randr: remove monitors.xml on auto-configurationMarc-Andre Lureau1-0/+5
GNOME will restore monitors.xml configuration whenever the timestamp "config > change". The "change" timestamp is the last user applied configuration, whereas the "config" timestamp is updated when the screen is updated or ouput/crtc modes are added/removed. These condition are triggered by vdagent during monitor config. Since we can't control the timestamps (playing with delay will be inherently event more racy), the only sane way I can think of is to disable gsd behaviour. This can be achieved by deleting the ~/.config/monitors.xml, which is the intended configuration to restore, so vdagent will override whatever configuration was saved previously. Somehow, if vdagent would be better integrated with gnome2, it would use the gnome-rr and/or org.gnome.SettingsDaemon.XRANDR dbus API. Thanksfully, in gnome3, the monitor auto-configuration has been merged in. https://bugzilla.redhat.com/show_bug.cgi?id=1086657
2015-04-10build-sys: Enable large file supportChristophe Fergeau1-0/+1
This is needed on 32 bit machines for drag and drop of large files (>2GB to work). This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1206663
2015-04-01Remove unneeded NULL checkChristophe Fergeau1-1/+1
Since previous commit, vdagent_x11_set_monitor_config() will return early if 'curr' is NULL so we don't need to explicitly check its value. Issue reported by the Coverity checker.
2015-04-01Handle get_current_mon_config() failuresChristophe Fergeau1-0/+2
get_current_mon_config() can return NULL, but vdagent_x11_set_monitor_config() was calling it without checking if it's NULL before dereferencing it. This issue was pinpointed by Coverity.
2015-03-27uinput: fix small leak of screen_infoVictor Toso1-0/+4
The following leak is fixed by this patch: ==2648== HEAP SUMMARY: ==2648== in use at exit: 104,699 bytes in 1,459 blocks ==2648== total heap usage: 14,177 allocs, 12,718 frees, 1,190,456 bytes allocated ==2648== ==2648== 16 bytes in 1 blocks are definitely lost in loss record 16 of 130 ==2648== at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==2648== by 0x10B530: agent_read_complete (vdagentd.c:715) ==2648== by 0x10E8DC: udscs_read_complete (udscs.c:460) ==2648== by 0x10EAFC: udscs_do_read (udscs.c:515) ==2648== by 0x10E490: udscs_client_handle_fds (udscs.c:349) ==2648== by 0x10E402: udscs_server_handle_fds (udscs.c:337) ==2648== by 0x10BAB1: main_loop (vdagentd.c:844) ==2648== by 0x10A3E6: main (vdagentd.c:974) ==2648== ==2648== LEAK SUMMARY: ==2648== definitely lost: 16 bytes in 1 blocks ==2648== indirectly lost: 0 bytes in 0 blocks ==2648== possibly lost: 41,483 bytes in 1,268 blocks ==2648== still reachable: 63,200 bytes in 190 blocks ==2648== suppressed: 0 bytes in 0 blocks ==2648== Reachable blocks (those to which a pointer was found) are not shown. ==2648== To see them, rerun with: --leak-check=full --show-leak-kinds=all
2014-09-18vdagent-file-xfers: only open the file transfer dir when all the files were ↵Fabiano Fidêncio1-1/+2
transferred Once transferring multiple files is supported, do not bother the user opening the file transfer directory for each file transferred, just do it when the last file transfer is finished.
2014-09-18Report an error when file transfers are disabledChristophe Fergeau3-0/+19
This commit sends back a VD_AGENT_FILE_XFER_STATUS_ERROR to clients which try to transfer files when the agent disabled file transfers (for example because there is no valid destination directory for the transferred files).
2014-09-18Disable file xfer when no suitable destination dirChristophe Fergeau1-5/+6
Currently, if no suitable destination directory can be found, the file transfer code defaults to using '.' as the destination directory. As this is unlikely to work, better to just disable file transfers when we end up in such a situation. This currently happens when spawning spice-vdagent from gdm where we don't want file transfers to be available anyway.
2014-09-18Make creation of 'vdagent_file_xfers' optionalChristophe Fergeau1-10/+20
This commit only adds if (vdagent_file_xfers != NULL) {} checks before calling into the file transfer code. This allows to disable file transfer handling by setting this variable to NULL.
2014-09-18Add g_return_if_fail() guards to file xfer public functionsChristophe Fergeau1-0/+10
With the next commit, we won't always have a file xfer object available. This next commit will make sure NULL is never passed to the public file xfer functions, but it's safer to guard against that anyway in case this gets broken in the future.