summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-08 20:15:10 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-08 21:19:39 +0900
commitbb9bb200008538d20d54d8eb70540db49c35fc6a (patch)
tree69f2c2b2b766849716d923cebfa14b7a7f26503a /src/lib/eina
parentc6ff925132e414ca1753de075ea1db45a62212ca (diff)
eina debug monitor - dont use XDG_RUNTIME_DIR if setuid
avoids possible issues with debug monitor + setuid
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_debug_monitor.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/eina/eina_debug_monitor.c b/src/lib/eina/eina_debug_monitor.c
index 06e939b9a4..1044d53c5a 100644
--- a/src/lib/eina/eina_debug_monitor.c
+++ b/src/lib/eina/eina_debug_monitor.c
@@ -650,10 +650,16 @@ _eina_debug_monitor_signal_init(void)
650static const char * 650static const char *
651_socket_home_get(void) 651_socket_home_get(void)
652{ 652{
653 static char *dir;
654
655 if (dir) return dir;
653 // get possible debug daemon socket directory base 656 // get possible debug daemon socket directory base
654 const char *dir = getenv("XDG_RUNTIME_DIR"); 657#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
655 if (!dir) dir = eina_environment_home_get(); 658 if (getuid() == geteuid()) dir = getenv("XDG_RUNTIME_DIR");
656 if (!dir) dir = eina_environment_tmp_get(); 659#endif
660 if (!dir) dir = (char *)eina_environment_home_get();
661 if (!dir) dir = (char *)eina_environment_tmp_get();
662 dir = strdup(dir);
657 return dir; 663 return dir;
658} 664}
659 665