[vdagent-linux 3/3] Disable file xfer when no suitable destination dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]