From 8e959890e732587bf73a09a214ca9bb984e9c623 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 9 Feb 2017 09:27:41 +0900 Subject: [PATCH] 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. --- src/lib/elput/elput_evdev.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index a83ebc1..8067f24 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) static int _keyboard_fd_get(off_t size) { + const char *path; + Eina_Tmpstr *fullname; + long flags; int fd = 0; - char *path; char tmp[PATH_MAX]; - long flags; - Eina_Tmpstr *fullname; - - if (!(path = getenv("XDG_RUNTIME_DIR"))) - return -1; + Efl_Vpath_File *file_obj; + file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, "(:run:)/"); + efl_vpath_file_do(file_obj); + efl_vpath_file_wait(file_obj); + path = efl_vpath_file_result_get(file_obj); snprintf(tmp, sizeof(tmp), "%s/elput-keymap-XXXXXX", path); + efl_del(file_obj); fd = eina_file_mkstemp(tmp, &fullname); if (fd < 0) return -1; -- 2.7.4