summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet_base.c
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-06-20 13:27:20 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-06-20 13:27:20 +0200
commitb1c97a0da41e9bc998b3d9cf5c724c297582068f (patch)
tree34ee230f2cb8190b2b11ad6847ce8abcf4919b35 /src/lib/efreet/efreet_base.c
parent068f1ddc628b8bff0b82a87201c2e753845c4978 (diff)
efreet: Create a temp XDG_RUNTIME_DIR if not set
Using /tmp as XDG_RUNTIME_DIR is pointless if we want it to be mode 0700
Diffstat (limited to '')
-rw-r--r--src/lib/efreet/efreet_base.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/efreet/efreet_base.c b/src/lib/efreet/efreet_base.c
index 22217bafc3..26346e0a65 100644
--- a/src/lib/efreet/efreet_base.c
+++ b/src/lib/efreet/efreet_base.c
@@ -303,7 +303,19 @@ efreet_dirs_init(void)
303 xdg_config_dirs = efreet_dirs_get("XDG_CONFIG_DIRS", "/etc/xdg"); 303 xdg_config_dirs = efreet_dirs_get("XDG_CONFIG_DIRS", "/etc/xdg");
304 304
305 /* xdg_runtime_dir */ 305 /* xdg_runtime_dir */
306 xdg_runtime_dir = efreet_dir_get("XDG_RUNTIME_DIR", "/tmp"); 306 xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
307 if (!xdg_runtime_dir)
308 {
309 snprintf(buf, sizeof(buf), "/tmp/xdg-XXXXXX");
310 xdg_runtime_dir = mkdtemp(buf);
311 if (!xdg_runtime_dir)
312 {
313 perror("efreet mkdtemp");
314 xdg_runtime_dir = "/tmp";
315 }
316 }
317 xdg_runtime_dir = eina_stringshare_add(xdg_runtime_dir);
318
307 if (stat(xdg_runtime_dir, &st) == -1) 319 if (stat(xdg_runtime_dir, &st) == -1)
308 { 320 {
309 ERR("$XDG_RUNTIME_DIR did not exist, creating '%s' (breaks spec)", 321 ERR("$XDG_RUNTIME_DIR did not exist, creating '%s' (breaks spec)",