englebass pushed a commit to branch master.
commit dd2758947060f2d527b0d7cb56f5bccc859ab3b1
Author: Sebastian Dransfeld <[email protected]>
Date: Thu Jun 20 13:29:37 2013 +0200
e: 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
---
src/bin/e_main.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/bin/e_main.c b/src/bin/e_main.c
index 5a10ffa..fd81bc6 100644
--- a/src/bin/e_main.c
+++ b/src/bin/e_main.c
@@ -151,7 +151,15 @@ _xdg_data_dirs_augment(void)
}
if (!getenv("XDG_RUNTIME_DIR"))
- e_util_env_set("XDG_RUNTIME_DIR", "/tmp");
+ {
+ char buf[PATH_MAX];
+ const char *dir;
+
+ snprintf(buf, sizeof(buf), "/tmp/xdg_runtime_XXXXXX");
+ dir = mkdtemp(buf);
+ if (!dir) dir = "/tmp";
+ e_util_env_set("XDG_RUNTIME_DIR", dir);
+ }
}
static void
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev