forked from enlightenment/efl
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.
This commit is contained in:
parent
75e1033682
commit
6b090a00b6
|
@ -51,15 +51,11 @@ 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);
|
||||
|
@ -68,15 +64,6 @@ main(int argc, char *argv[])
|
|||
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;
|
||||
}
|
||||
}
|
||||
log = fdopen(fd, "wb");
|
||||
if (!log) goto tmp_error;
|
||||
eina_log_print_cb_set(eina_log_print_cb_file, log);
|
||||
|
|
Loading…
Reference in New Issue