summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor Saunders <trev.saunders@gmail.com>2010-08-05 19:11:34 -0400
committerMike Gorse <mgorse@novell.com>2010-08-30 21:12:16 -0400
commit9f1335d701d7c4ee0217d5a28c31a9e85a99da32 (patch)
tree0b43b548dc70b88b83f73f0a361e10d23a473734
parente22f9c72c4c3e4a52d1f64e5f37afd5cf16ac610 (diff)
downloadat-spi2-atk-9f1335d701d7c4ee0217d5a28c31a9e85a99da32.tar.gz
improve how the dbus address is handled
Create unique socket names of the form /tmp/at-spi2/socket-<pid>-<random number> This should be much safer than the old method since each process should have only one dbus server socket, and the random number should protect against uncleaned up sockets. Also set permissions on directory for dbus server sockets.
-rw-r--r--atk-adaptor/bridge.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c
index 80d3f8e..86dcc82 100644
--- a/atk-adaptor/bridge.c
+++ b/atk-adaptor/bridge.c
@@ -32,6 +32,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
+#include<sys/stat.h>
#include <atk/atk.h>
#include <droute/droute.h>
@@ -332,8 +333,10 @@ register_application (SpiBridge * app)
/* could this be better, we accept some amount of race in getting the temp name*/
/* make sure the directory exists */
-mkdir("/tmp/at-spi2/", 0);
-app->app_bus_addr = mktemp(file_template);
+mkdir("/tmp/at-spi2/", S_IRWXU);
+app->app_bus_addr = g_malloc(max_addr_length * sizeof(char));
+sprintf(app->app_bus_addr, "unix:path=/tmp/at-spi2/socket-%d-%d", getpid(),
+rand());
}
else
{