aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-09 15:48:11 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-09 18:38:28 +0900
commit6b090a00b6b7b2d76948f36079204a1ee26ae468 (patch)
tree9f0fd38ddcf50bc0d12decc682ef084ad8c233c7 /src/bin/efreet
parentefreet - use vpath to get XDG_RUNTIME_DIR so we have a single impl (diff)
downloadefl-6b090a00b6b7b2d76948f36079204a1ee26ae468.tar.gz
efreetd - dont use XDG_RUNTIME_DIR or EFREET_LOG env vars for setuid
if a setuid app needs efreet - it will not be able to contact the users' efreetd and thus may spawn it's own... and thus we cant have this now spawned efreetd using env vars inherited from the unpriveleged etc. user, so ignore them.
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreetd.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index 8ed670d75f..2da069aa28 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -51,31 +51,18 @@ main(int argc, char *argv[])
if (!ipc_init()) goto ipc_error;
if (!cache_init()) goto cache_error;
- s = getenv("XDG_RUNTIME_DIR");
- if (s) log_file_dir = s;
- else log_file_dir = eina_environment_tmp_get();
+ log_file_dir = eina_environment_tmp_get();
if (gethostname(buf, sizeof(buf)) < 0)
hostname_str = "";
else
hostname_str = buf;
- if (getenv("EFREETD_LOG"))
+ snprintf(path, sizeof(path), "%s/efreetd_%s_XXXXXX.log",
+ log_file_dir, hostname_str);
+ fd = eina_file_mkstemp(path, NULL);
+ if (fd < 0)
{
- snprintf(path, sizeof(path), "%s/efreetd_%s_XXXXXX.log",
- log_file_dir, hostname_str);
- fd = eina_file_mkstemp(path, NULL);
- if (fd < 0)
- {
- ERR("Can't create log file '%s'\b", path);;
- goto tmp_error;
- }
- }
- else
- {
- fd = open("/dev/null", O_WRONLY);
- if (fd < 0)
- {
- goto tmp_error;
- }
+ ERR("Can't create log file '%s'\b", path);;
+ goto tmp_error;
}
log = fdopen(fd, "wb");
if (!log) goto tmp_error;