Blame SOURCES/0022-Disable-file-xfer-when-no-suitable-destination-dir.patch

a547b4
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a547b4
From: Christophe Fergeau <cfergeau@redhat.com>
a547b4
Date: Thu, 27 Mar 2014 18:04:59 +0100
a547b4
Subject: [PATCH] Disable file xfer when no suitable destination dir
a547b4
a547b4
Currently, if no suitable destination directory can be found, the file
a547b4
transfer code defaults to using '.' as the destination directory. As this
a547b4
is unlikely to work, better to just disable file transfers when we end up
a547b4
in such a situation. This currently happens when spawning spice-vdagent
a547b4
from gdm where we don't want file transfers to be available anyway.
a547b4
a547b4
(cherry picked from commit 689dcd35edb55abcdef4d30d92fdcca22d81ee23)
a547b4
---
a547b4
 src/vdagent.c | 11 ++++++-----
a547b4
 1 file changed, 6 insertions(+), 5 deletions(-)
a547b4
a547b4
diff --git a/src/vdagent.c b/src/vdagent.c
a547b4
index 9586432..32c84e5 100644
a547b4
--- a/src/vdagent.c
a547b4
+++ b/src/vdagent.c
a547b4
@@ -282,13 +282,14 @@ reconnect:
a547b4
         fx_dir = g_get_user_special_dir(G_USER_DIRECTORY_DESKTOP);
a547b4
     else if (!strcmp(fx_dir, "xdg-download"))
a547b4
         fx_dir = g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD);
a547b4
-    if (!fx_dir) {
a547b4
+    if (fx_dir) {
a547b4
+        vdagent_file_xfers = vdagent_file_xfers_create(client, fx_dir,
a547b4
+                                                       fx_open_dir, debug);
a547b4
+    } else {
a547b4
         syslog(LOG_WARNING,
a547b4
-               "warning could not get file xfer save dir, using cwd");
a547b4
-        fx_dir = ".";
a547b4
+               "warning could not get file xfer save dir, file transfers will be disabled");
a547b4
+        vdagent_file_xfers = NULL;
a547b4
     }
a547b4
-    vdagent_file_xfers = vdagent_file_xfers_create(client, fx_dir,
a547b4
-                                                   fx_open_dir, debug);
a547b4
 
a547b4
     while (client && !quit) {
a547b4
         FD_ZERO(&readfds);