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.
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
+#include<sys/stat.h>
#include <atk/atk.h>
#include <droute/droute.h>
/* 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
{