[glib/glib-2-32] gdbus: Escape nonce files in dbus addressess



commit 27352d96e28cf9e65bce12e2250a679261872aae
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Apr 17 15:50:53 2012 +0200

    gdbus: Escape nonce files in dbus addressess
    
    Otherwise the colon in c:\blah made for trouble
    (cherry picked from commit 82aecce30131e275dff73f23ee91e7c40a9b3f03)

 gio/gdbusserver.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/gdbusserver.c b/gio/gdbusserver.c
index 5e7dd85..e132b70 100644
--- a/gio/gdbusserver.c
+++ b/gio/gdbusserver.c
@@ -843,6 +843,7 @@ try_tcp (GDBusServer  *server,
       guint n;
       gsize bytes_written;
       gsize bytes_remaining;
+      char *file_escaped;
 
       server->nonce = g_new0 (guchar, 16);
       for (n = 0; n < 16; n++)
@@ -878,10 +879,12 @@ try_tcp (GDBusServer  *server,
           bytes_remaining -= ret;
         }
       close (fd);
+      file_escaped = g_uri_escape_string (server->nonce_file, "/\\", FALSE);
       server->client_address = g_strdup_printf ("nonce-tcp:host=%s,port=%d,noncefile=%s",
                                                 host,
                                                 port_num,
-                                                server->nonce_file);
+                                                file_escaped);
+      g_free (file_escaped);
     }
   else
     {



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