[Spice-devel] [vdagent-linux 3/3] Disable file xfer when no suitable destination dir
Marc-André Lureau
marcandre.lureau at gmail.com
Tue Apr 1 09:55:36 PDT 2014
ack...
although it would be nicer to send back a VDAGENTD_FILE_XFER_STATUS_ERROR
to interrupt client whenever xfer message comes in.
On Tue, Apr 1, 2014 at 4:24 PM, Christophe Fergeau <cfergeau at redhat.com>wrote:
> 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.
> ---
> src/vdagent.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/src/vdagent.c b/src/vdagent.c
> index 3ab2352..50498ef 100644
> --- a/src/vdagent.c
> +++ b/src/vdagent.c
> @@ -275,13 +275,14 @@ reconnect:
> fx_dir = g_get_user_special_dir(G_USER_DIRECTORY_DESKTOP);
> else if (!strcmp(fx_dir, "xdg-download"))
> fx_dir = g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD);
> - if (!fx_dir) {
> + if (fx_dir) {
> + vdagent_file_xfers = vdagent_file_xfers_create(client, fx_dir,
> + fx_open_dir,
> debug);
> + } else {
> syslog(LOG_WARNING,
> - "warning could not get file xfer save dir, using cwd");
> - fx_dir = ".";
> + "warning could not get file xfer save dir, file transfers
> will be disabled");
> + vdagent_file_xfers = NULL;
> }
> - vdagent_file_xfers = vdagent_file_xfers_create(client, fx_dir,
> - fx_open_dir, debug);
>
> while (client && !quit) {
> FD_ZERO(&readfds);
> --
> 1.9.0
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
--
Marc-André Lureau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140401/3a55ece9/attachment.html>
More information about the Spice-devel
mailing list