diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2017-02-09 09:27:41 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2017-02-09 09:28:47 +0900 |
commit | 8e959890e732587bf73a09a214ca9bb984e9c623 (patch) | |
tree | a074c2057e8aa8e4cba1ab04e241383769e2c2fb /src | |
parent | 0f446c10bef93b57773cb259ec5b762ac542e7b4 (diff) |
elput - use vpath to get xdg runtime to also be setuid safe
this time around... use a / at the end of the (:run:) virtual dir
path to make it work.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/elput/elput_evdev.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index a83ebc10de..8067f24783 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c | |||
@@ -60,16 +60,19 @@ _keyboard_modifiers_update(Elput_Keyboard *kbd, Elput_Seat *seat) | |||
60 | static int | 60 | static int |
61 | _keyboard_fd_get(off_t size) | 61 | _keyboard_fd_get(off_t size) |
62 | { | 62 | { |
63 | const char *path; | ||
64 | Eina_Tmpstr *fullname; | ||
65 | long flags; | ||
63 | int fd = 0; | 66 | int fd = 0; |
64 | char *path; | ||
65 | char tmp[PATH_MAX]; | 67 | char tmp[PATH_MAX]; |
66 | long flags; | 68 | Efl_Vpath_File *file_obj; |
67 | Eina_Tmpstr *fullname; | ||
68 | |||
69 | if (!(path = getenv("XDG_RUNTIME_DIR"))) | ||
70 | return -1; | ||
71 | 69 | ||
70 | file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/"); | ||
71 | efl_vpath_file_do(file_obj); | ||
72 | efl_vpath_file_wait(file_obj); | ||
73 | path = efl_vpath_file_result_get(file_obj); | ||
72 | snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path); | 74 | snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path); |
75 | efl_del(file_obj); | ||
73 | 76 | ||
74 | fd = eina_file_mkstemp(tmp, &fullname); | 77 | fd = eina_file_mkstemp(tmp, &fullname); |
75 | if (fd < 0) return -1; | 78 | if (fd < 0) return -1; |