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

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