summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2013-06-20 13:29:37 +0200
committerSebastian Dransfeld <sd@tango.flipp.net>2013-06-20 13:29:37 +0200
commitdd2758947060f2d527b0d7cb56f5bccc859ab3b1 (patch)
tree84573cce6b49151abe3d7409a7bd1590604140ea /src
parent6f2ce10eb14ec5411b0a38681ec02b5e7cac8223 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bin/e_main.c b/src/bin/e_main.c
index 5a10ffa30..fd81bc64f 100644
--- a/src/bin/e_main.c
+++ b/src/bin/e_main.c
@@ -151,7 +151,15 @@ _xdg_data_dirs_augment(void)
151 } 151 }
152 152
153 if (!getenv("XDG_RUNTIME_DIR")) 153 if (!getenv("XDG_RUNTIME_DIR"))
154 e_util_env_set("XDG_RUNTIME_DIR", "/tmp"); 154 {
155 char buf[PATH_MAX];
156 const char *dir;
157
158 snprintf(buf, sizeof(buf), "/tmp/xdg_runtime_XXXXXX");
159 dir = mkdtemp(buf);
160 if (!dir) dir = "/tmp";
161 e_util_env_set("XDG_RUNTIME_DIR", dir);
162 }
155} 163}
156 164
157static void 165static void