From: Trevor Saunders Date: Thu, 5 Aug 2010 23:11:34 +0000 (-0400) Subject: improve how the dbus address is handled X-Git-Tag: AT_SPI2_ATK_2_12_0~336^2~8 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git;a=commitdiff_plain;h=9f1335d701d7c4ee0217d5a28c31a9e85a99da32 improve how the dbus address is handled Create unique socket names of the form /tmp/at-spi2/socket-- 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. --- 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 #include #include +#include #include #include @@ -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 {