forked from enlightenment/efl
setuid safeness - ensure if an app that is setuid doesn't do bad things
this makes efl ignore certain env vars for thnigs and entirely removes user modules (that no one ever used) etc. etc. to ensure that *IF* an app is setuid, there isn't a priv escalation path that is easy.
This commit is contained in:
parent
323f293ab5
commit
b95ef3801f
|
@ -130,55 +130,42 @@ static void
|
||||||
ecore_system_modules_load(void)
|
ecore_system_modules_load(void)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX] = "";
|
char buf[PATH_MAX] = "";
|
||||||
char *path;
|
|
||||||
|
|
||||||
if (getenv("EFL_RUN_IN_TREE"))
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
struct stat st;
|
if (getenv("EFL_RUN_IN_TREE"))
|
||||||
snprintf(buf, sizeof(buf), "%s/src/modules/ecore/system",
|
|
||||||
PACKAGE_BUILD_DIR);
|
|
||||||
if (stat(buf, &st) == 0)
|
|
||||||
{
|
{
|
||||||
const char *built_modules[] = {
|
struct stat st;
|
||||||
|
snprintf(buf, sizeof(buf), "%s/src/modules/ecore/system",
|
||||||
|
PACKAGE_BUILD_DIR);
|
||||||
|
if (stat(buf, &st) == 0)
|
||||||
|
{
|
||||||
|
const char *built_modules[] = {
|
||||||
#ifdef HAVE_SYSTEMD
|
#ifdef HAVE_SYSTEMD
|
||||||
"systemd",
|
"systemd",
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
|
#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
|
||||||
"tizen",
|
"tizen",
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
const char **itr;
|
const char **itr;
|
||||||
for (itr = built_modules; *itr != NULL; itr++)
|
for (itr = built_modules; *itr != NULL; itr++)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"%s/src/modules/ecore/system/%s/.libs",
|
"%s/src/modules/ecore/system/%s/.libs",
|
||||||
PACKAGE_BUILD_DIR, *itr);
|
PACKAGE_BUILD_DIR, *itr);
|
||||||
module_list = eina_module_list_get(module_list, buf,
|
module_list = eina_module_list_get(module_list, buf,
|
||||||
EINA_FALSE, NULL, NULL);
|
EINA_FALSE, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (module_list)
|
||||||
|
eina_module_list_load(module_list);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (module_list)
|
|
||||||
eina_module_list_load(module_list);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path = eina_module_environment_path_get("ECORE_MODULES_DIR",
|
|
||||||
"/ecore/system");
|
|
||||||
if (path)
|
|
||||||
{
|
|
||||||
module_list = eina_module_arch_list_get(module_list, path, MODULE_ARCH);
|
|
||||||
free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
path = eina_module_environment_path_get("HOME", "/.ecore/system");
|
|
||||||
if (path)
|
|
||||||
{
|
|
||||||
module_list = eina_module_arch_list_get(module_list, path, MODULE_ARCH);
|
|
||||||
free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/ecore/system",
|
snprintf(buf, sizeof(buf), "%s/ecore/system",
|
||||||
eina_prefix_lib_get(_ecore_pfx));
|
eina_prefix_lib_get(_ecore_pfx));
|
||||||
module_list = eina_module_arch_list_get(module_list, buf, MODULE_ARCH);
|
module_list = eina_module_arch_list_get(module_list, buf, MODULE_ARCH);
|
||||||
|
|
|
@ -1609,7 +1609,7 @@ _ecore_exe_exec_it(const char *exe_cmd,
|
||||||
{
|
{
|
||||||
if (!shell) /* Find users preferred shell. */
|
if (!shell) /* Find users preferred shell. */
|
||||||
{
|
{
|
||||||
shell = getenv("SHELL");
|
if (getuid() == getuid()) shell = getenv("SHELL");
|
||||||
if (!shell)
|
if (!shell)
|
||||||
shell = "/bin/sh";
|
shell = "/bin/sh";
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
|
||||||
#ifdef HAVE_SYSTEMD
|
#ifdef HAVE_SYSTEMD
|
||||||
# include <systemd/sd-daemon.h>
|
# include <systemd/sd-daemon.h>
|
||||||
|
@ -72,19 +73,33 @@ ecore_con_local_connect(Ecore_Con_Server *svr,
|
||||||
|
|
||||||
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
|
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
|
||||||
{
|
{
|
||||||
homedir = getenv("XDG_RUNTIME_DIR");
|
if (getuid() == getuid())
|
||||||
if (!homedir)
|
|
||||||
{
|
{
|
||||||
homedir = getenv("HOME");
|
homedir = getenv("XDG_RUNTIME_DIR");
|
||||||
if (!homedir)
|
if (!homedir)
|
||||||
{
|
{
|
||||||
homedir = getenv("TMP");
|
homedir = getenv("HOME");
|
||||||
if (!homedir) homedir = "/tmp";
|
if (!homedir)
|
||||||
|
{
|
||||||
|
homedir = getenv("TMP");
|
||||||
|
if (!homedir) homedir = "/tmp";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, svr->name,
|
||||||
|
svr->port);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct passwd *pw = getpwent();
|
||||||
|
|
||||||
|
if ((!pw) || (!pw->pw_dir))
|
||||||
|
snprintf(buf, sizeof(buf), "/tmp/%s/%i", svr->name,
|
||||||
|
svr->port);
|
||||||
|
else
|
||||||
|
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", pw->pw_dir, svr->name,
|
||||||
|
svr->port);
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, svr->name,
|
|
||||||
svr->port);
|
|
||||||
}
|
}
|
||||||
else if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_SYSTEM)
|
else if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_SYSTEM)
|
||||||
{
|
{
|
||||||
|
@ -203,16 +218,26 @@ ecore_con_local_listen(
|
||||||
|
|
||||||
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
|
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
|
||||||
{
|
{
|
||||||
homedir = getenv("XDG_RUNTIME_DIR");
|
if (getuid() == getuid())
|
||||||
if (!homedir)
|
|
||||||
{
|
{
|
||||||
homedir = getenv("HOME");
|
homedir = getenv("XDG_RUNTIME_DIR");
|
||||||
if (!homedir)
|
if (!homedir)
|
||||||
{
|
{
|
||||||
homedir = getenv("TMP");
|
homedir = getenv("HOME");
|
||||||
if (!homedir) homedir = "/tmp";
|
if (!homedir)
|
||||||
|
{
|
||||||
|
homedir = getenv("TMP");
|
||||||
|
if (!homedir) homedir = "/tmp";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct passwd *pw = getpwent();
|
||||||
|
|
||||||
|
if ((!pw) || (!pw->pw_dir)) homedir = "/tmp";
|
||||||
|
else homedir = pw->pw_dir;
|
||||||
|
}
|
||||||
|
|
||||||
mask = S_IRUSR | S_IWUSR | S_IXUSR;
|
mask = S_IRUSR | S_IWUSR | S_IXUSR;
|
||||||
snprintf(buf, sizeof(buf), "%s/.ecore", homedir);
|
snprintf(buf, sizeof(buf), "%s/.ecore", homedir);
|
||||||
|
|
|
@ -414,7 +414,7 @@ ecore_con_local_listen(Ecore_Con_Server *svr)
|
||||||
{
|
{
|
||||||
const char *computername;
|
const char *computername;
|
||||||
|
|
||||||
computername = getenv("CoMPUTERNAME");
|
computername = getenv("COMPUTERNAME");
|
||||||
snprintf(buf, sizeof(buf), "\\\\%s\\pipe\\%s", computername, svr->name);
|
snprintf(buf, sizeof(buf), "\\\\%s\\pipe\\%s", computername, svr->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -585,7 +585,7 @@ ecore_con_socks_dns_cb(const char *canonname EINA_UNUSED, const char *ip, struct
|
||||||
void
|
void
|
||||||
ecore_con_socks_init(void)
|
ecore_con_socks_init(void)
|
||||||
{
|
{
|
||||||
const char *socks;
|
const char *socks = NULL;
|
||||||
char *h, *p, *l, *u = NULL;
|
char *h, *p, *l, *u = NULL;
|
||||||
char buf[512];
|
char buf[512];
|
||||||
int port, lookup = 0;
|
int port, lookup = 0;
|
||||||
|
@ -596,13 +596,16 @@ ecore_con_socks_init(void)
|
||||||
unsigned char addr6[sizeof(struct in6_addr)];
|
unsigned char addr6[sizeof(struct in6_addr)];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ECORE_CON_SOCKS_V4=[user@]host-port:[1|0] */
|
if (getuid() == getuid())
|
||||||
socks = getenv("ECORE_CON_SOCKS_V4");
|
|
||||||
if (!socks)
|
|
||||||
{
|
{
|
||||||
/* ECORE_CON_SOCKS_V5=[user@]host-port:[1|0] */
|
/* ECORE_CON_SOCKS_V4=[user@]host-port:[1|0] */
|
||||||
socks = getenv("ECORE_CON_SOCKS_V5");
|
socks = getenv("ECORE_CON_SOCKS_V4");
|
||||||
v5 = EINA_TRUE;
|
if (!socks)
|
||||||
|
{
|
||||||
|
/* ECORE_CON_SOCKS_V5=[user@]host-port:[1|0] */
|
||||||
|
socks = getenv("ECORE_CON_SOCKS_V5");
|
||||||
|
v5 = EINA_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ((!socks) || (!socks[0]) || (strlen(socks) + 1 > 512)) return;
|
if ((!socks) || (!socks[0]) || (strlen(socks) + 1 > 512)) return;
|
||||||
memcpy(buf, socks, strlen(socks) + 1);
|
memcpy(buf, socks, strlen(socks) + 1);
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "Ecore_Evas.h"
|
#include "Ecore_Evas.h"
|
||||||
#include "ecore_evas_private.h"
|
#include "ecore_evas_private.h"
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
static Eina_Hash *_registered_engines = NULL;
|
static Eina_Hash *_registered_engines = NULL;
|
||||||
static Eina_List *_engines_paths = NULL;
|
static Eina_List *_engines_paths = NULL;
|
||||||
|
@ -38,13 +39,16 @@ _ecore_evas_engine_load(const char *engine)
|
||||||
{
|
{
|
||||||
char tmp[PATH_MAX] = "";
|
char tmp[PATH_MAX] = "";
|
||||||
|
|
||||||
if (run_in_tree)
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
struct stat st;
|
if (run_in_tree)
|
||||||
snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
|
{
|
||||||
path, engine, ECORE_EVAS_ENGINE_NAME);
|
struct stat st;
|
||||||
if (stat(tmp, &st) != 0)
|
snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
|
||||||
tmp[0] = '\0';
|
path, engine, ECORE_EVAS_ENGINE_NAME);
|
||||||
|
if (stat(tmp, &st) != 0)
|
||||||
|
tmp[0] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp[0] == '\0')
|
if (tmp[0] == '\0')
|
||||||
|
@ -69,7 +73,7 @@ _ecore_evas_engine_load(const char *engine)
|
||||||
void
|
void
|
||||||
_ecore_evas_engine_init(void)
|
_ecore_evas_engine_init(void)
|
||||||
{
|
{
|
||||||
char *paths[4] = { NULL, NULL, NULL, NULL };
|
char *paths[2] = { NULL, NULL };
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
|
|
||||||
|
@ -77,26 +81,25 @@ _ecore_evas_engine_init(void)
|
||||||
// _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
|
// _registered_engines = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
|
||||||
_registered_engines = eina_hash_string_small_new(NULL);
|
_registered_engines = eina_hash_string_small_new(NULL);
|
||||||
|
|
||||||
if (getenv("EFL_RUN_IN_TREE"))
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
struct stat st;
|
if (getenv("EFL_RUN_IN_TREE"))
|
||||||
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
|
|
||||||
if (stat(mp, &st) == 0)
|
|
||||||
{
|
{
|
||||||
_engines_paths = eina_list_append(_engines_paths, strdup(mp));
|
struct stat st;
|
||||||
return;
|
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
|
||||||
|
if (stat(mp, &st) == 0)
|
||||||
|
{
|
||||||
|
_engines_paths = eina_list_append(_engines_paths, strdup(mp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 1. ~/.ecore_evas/modules/ */
|
/* 1. libecore_evas.so/../ecore_evas/engines/ */
|
||||||
paths[0] = eina_module_environment_path_get("HOME", "/.ecore_evas/engines");
|
paths[0] = eina_module_symbol_path_get(_ecore_evas_engine_init, "/ecore_evas/engines");
|
||||||
/* 2. $(ECORE_ENGINE_DIR)/ecore_evas/modules/ */
|
/* 2. PREFIX/ecore_evas/engines/ */
|
||||||
paths[1] = eina_module_environment_path_get("ECORE_EVAS_ENGINES_DIR", "/ecore_evas/engines");
|
|
||||||
/* 3. libecore_evas.so/../ecore_evas/engines/ */
|
|
||||||
paths[2] = eina_module_symbol_path_get(_ecore_evas_engine_init, "/ecore_evas/engines");
|
|
||||||
/* 4. PREFIX/ecore_evas/engines/ */
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
paths[3] = strdup(PACKAGE_LIB_DIR "/ecore_evas/engines");
|
paths[1] = strdup(PACKAGE_LIB_DIR "/ecore_evas/engines");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (j = 0; j < ((sizeof (paths) / sizeof (char*)) - 1); ++j)
|
for (j = 0; j < ((sizeof (paths) / sizeof (char*)) - 1); ++j)
|
||||||
|
|
|
@ -108,7 +108,7 @@ _ecore_fb_size_get(int *w, int *h)
|
||||||
struct fb_var_screeninfo fb_var;
|
struct fb_var_screeninfo fb_var;
|
||||||
int fb;
|
int fb;
|
||||||
|
|
||||||
if (getenv("EVAS_FB_DEV"))
|
if ((getuid() == getuid()) && (getenv("EVAS_FB_DEV")))
|
||||||
fb = open(getenv("EVAS_FB_DEV"), O_RDWR);
|
fb = open(getenv("EVAS_FB_DEV"), O_RDWR);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -81,7 +81,7 @@ ecore_fb_ts_init(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_TSLIB
|
#ifdef HAVE_TSLIB
|
||||||
char *tslib_tsdevice = NULL;
|
char *tslib_tsdevice = NULL;
|
||||||
if ( (tslib_tsdevice = getenv("TSLIB_TSDEVICE")) )
|
if ((getuid() == getuid()) && ((tslib_tsdevice = getenv("TSLIB_TSDEVICE"))))
|
||||||
{
|
{
|
||||||
printf( "ECORE_FB: TSLIB_TSDEVICE = '%s'\n", tslib_tsdevice );
|
printf( "ECORE_FB: TSLIB_TSDEVICE = '%s'\n", tslib_tsdevice );
|
||||||
_ecore_fb_tslib_tsdev = ts_open( tslib_tsdevice, 1 ); /* 1 = nonblocking, 0 = blocking */
|
_ecore_fb_tslib_tsdev = ts_open( tslib_tsdevice, 1 ); /* 1 = nonblocking, 0 = blocking */
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
#include <ecore_private.h>
|
#include <ecore_private.h>
|
||||||
|
@ -30,66 +31,52 @@ void
|
||||||
ecore_imf_module_init(void)
|
ecore_imf_module_init(void)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX] = "";
|
char buf[PATH_MAX] = "";
|
||||||
char *path;
|
|
||||||
|
|
||||||
pfx = eina_prefix_new(NULL, ecore_imf_init,
|
pfx = eina_prefix_new(NULL, ecore_imf_init,
|
||||||
"ECORE_IMF", "ecore_imf", "checkme",
|
"ECORE_IMF", "ecore_imf", "checkme",
|
||||||
PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
|
PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
|
||||||
PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
|
PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
|
||||||
|
if (getuid() == getuid())
|
||||||
if (getenv("EFL_RUN_IN_TREE"))
|
|
||||||
{
|
{
|
||||||
struct stat st;
|
if (getenv("EFL_RUN_IN_TREE"))
|
||||||
snprintf(buf, sizeof(buf), "%s/src/modules/ecore_imf",
|
|
||||||
PACKAGE_BUILD_DIR);
|
|
||||||
if (stat(buf, &st) == 0)
|
|
||||||
{
|
{
|
||||||
const char *built_modules[] = {
|
struct stat st;
|
||||||
|
snprintf(buf, sizeof(buf), "%s/src/modules/ecore_imf",
|
||||||
|
PACKAGE_BUILD_DIR);
|
||||||
|
if (stat(buf, &st) == 0)
|
||||||
|
{
|
||||||
|
const char *built_modules[] = {
|
||||||
#ifdef ENABLE_XIM
|
#ifdef ENABLE_XIM
|
||||||
"xim",
|
"xim",
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUILD_ECORE_IMF_IBUS
|
#ifdef BUILD_ECORE_IMF_IBUS
|
||||||
"ibus",
|
"ibus",
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUILD_ECORE_IMF_SCIM
|
#ifdef BUILD_ECORE_IMF_SCIM
|
||||||
"scim",
|
"scim",
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUILD_ECORE_IMF_WAYLAND
|
#ifdef BUILD_ECORE_IMF_WAYLAND
|
||||||
"wayland",
|
"wayland",
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
const char **itr;
|
const char **itr;
|
||||||
for (itr = built_modules; *itr != NULL; itr++)
|
for (itr = built_modules; *itr != NULL; itr++)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"%s/src/modules/ecore_imf/%s/.libs",
|
"%s/src/modules/ecore_imf/%s/.libs",
|
||||||
PACKAGE_BUILD_DIR, *itr);
|
PACKAGE_BUILD_DIR, *itr);
|
||||||
module_list = eina_module_list_get(module_list, buf,
|
module_list = eina_module_list_get(module_list, buf,
|
||||||
EINA_FALSE, NULL, NULL);
|
EINA_FALSE, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (module_list)
|
||||||
|
eina_module_list_load(module_list);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (module_list)
|
|
||||||
eina_module_list_load(module_list);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path = eina_module_environment_path_get("ECORE_IMF_MODULES_DIR",
|
|
||||||
"/ecore_imf/modules");
|
|
||||||
if (path)
|
|
||||||
{
|
|
||||||
module_list = eina_module_arch_list_get(module_list, path, MODULE_ARCH);
|
|
||||||
free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
path = eina_module_environment_path_get("HOME", "/.ecore_imf");
|
|
||||||
if (path)
|
|
||||||
{
|
|
||||||
module_list = eina_module_arch_list_get(module_list, path, MODULE_ARCH);
|
|
||||||
free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/ecore_imf/modules", eina_prefix_lib_get(pfx));
|
snprintf(buf, sizeof(buf), "%s/ecore_imf/modules", eina_prefix_lib_get(pfx));
|
||||||
module_list = eina_module_arch_list_get(module_list, buf, MODULE_ARCH);
|
module_list = eina_module_arch_list_get(module_list, buf, MODULE_ARCH);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "ecore_xcb_private.h"
|
#include "ecore_xcb_private.h"
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static Eina_Bool _ecore_xcb_xdefaults_glob_match(const char *str,
|
static Eina_Bool _ecore_xcb_xdefaults_glob_match(const char *str,
|
||||||
|
@ -16,7 +18,19 @@ _ecore_xcb_xdefaults_init(void)
|
||||||
|
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
|
|
||||||
snprintf(buff, sizeof(buff), "%s/.Xdefaults", getenv("HOME"));
|
if (getuid() == getuid())
|
||||||
|
{
|
||||||
|
if (getenv("HOME"))
|
||||||
|
snprintf(buff, sizeof(buff), "%s/.Xdefaults", getenv("HOME"));
|
||||||
|
else return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct passwd *pw = getpwent();
|
||||||
|
|
||||||
|
if ((!pw) || (!pw->pw_dir)) return;
|
||||||
|
snprintf(buff, sizeof(buff), "%s/.Xdefaults", pw->pw_dir);
|
||||||
|
}
|
||||||
if ((_ecore_xcb_xdefaults_file = eina_file_open(buff, EINA_FALSE)))
|
if ((_ecore_xcb_xdefaults_file = eina_file_open(buff, EINA_FALSE)))
|
||||||
{
|
{
|
||||||
eina_mmap_safety_enabled_set(EINA_TRUE);
|
eina_mmap_safety_enabled_set(EINA_TRUE);
|
||||||
|
|
|
@ -6808,15 +6808,18 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
|
||||||
#else
|
#else
|
||||||
# define BIN_EXT
|
# define BIN_EXT
|
||||||
#endif
|
#endif
|
||||||
if (getenv("EFL_RUN_IN_TREE"))
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
snprintf(embryo_cc_path, sizeof(embryo_cc_path),
|
if (getenv("EFL_RUN_IN_TREE"))
|
||||||
"%s/src/bin/embryo/embryo_cc" BIN_EXT,
|
{
|
||||||
PACKAGE_BUILD_DIR);
|
snprintf(embryo_cc_path, sizeof(embryo_cc_path),
|
||||||
snprintf(inc_path, sizeof(inc_path),
|
"%s/src/bin/embryo/embryo_cc" BIN_EXT,
|
||||||
"%s/data/edje/include", PACKAGE_BUILD_DIR);
|
PACKAGE_BUILD_DIR);
|
||||||
if (!ecore_file_exists(embryo_cc_path))
|
snprintf(inc_path, sizeof(inc_path),
|
||||||
embryo_cc_path[0] = '\0';
|
"%s/data/edje/include", PACKAGE_BUILD_DIR);
|
||||||
|
if (!ecore_file_exists(embryo_cc_path))
|
||||||
|
embryo_cc_path[0] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (embryo_cc_path[0] == '\0')
|
if (embryo_cc_path[0] == '\0')
|
||||||
|
|
|
@ -37,13 +37,16 @@ _edje_module_handle_load(const char *module)
|
||||||
{
|
{
|
||||||
char tmp[PATH_MAX] = "";
|
char tmp[PATH_MAX] = "";
|
||||||
|
|
||||||
if (run_in_tree)
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
struct stat st;
|
if (run_in_tree)
|
||||||
snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
|
{
|
||||||
path, module, EDJE_MODULE_NAME);
|
struct stat st;
|
||||||
if (stat(tmp, &st) != 0)
|
snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
|
||||||
tmp[0] = '\0';
|
path, module, EDJE_MODULE_NAME);
|
||||||
|
if (stat(tmp, &st) != 0)
|
||||||
|
tmp[0] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp[0] == '\0')
|
if (tmp[0] == '\0')
|
||||||
|
@ -68,32 +71,31 @@ _edje_module_handle_load(const char *module)
|
||||||
void
|
void
|
||||||
_edje_module_init(void)
|
_edje_module_init(void)
|
||||||
{
|
{
|
||||||
char *paths[4] = { NULL, NULL, NULL, NULL };
|
char *paths[2] = { NULL, NULL };
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
|
|
||||||
_registered_modules = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
|
_registered_modules = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
|
||||||
|
|
||||||
if (getenv("EFL_RUN_IN_TREE"))
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
struct stat st;
|
if (getenv("EFL_RUN_IN_TREE"))
|
||||||
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/edje";
|
|
||||||
if (stat(mp, &st) == 0)
|
|
||||||
{
|
{
|
||||||
_modules_paths = eina_list_append(_modules_paths, strdup(mp));
|
struct stat st;
|
||||||
return;
|
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/edje";
|
||||||
|
if (stat(mp, &st) == 0)
|
||||||
|
{
|
||||||
|
_modules_paths = eina_list_append(_modules_paths, strdup(mp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 1. ~/.edje/modules/ */
|
/* 1. libedje.so/../edje/modules/ */
|
||||||
paths[0] = eina_module_environment_path_get("HOME", "/.edje/modules");
|
paths[0] = eina_module_symbol_path_get(_edje_module_init, "/edje/modules");
|
||||||
/* 2. $(EDJE_MODULE_DIR)/edje/modules/ */
|
/* 2. PREFIX/edje/modules/ */
|
||||||
paths[1] = eina_module_environment_path_get("EDJE_MODULES_DIR", "/edje/modules");
|
|
||||||
/* 3. libedje.so/../edje/modules/ */
|
|
||||||
paths[2] = eina_module_symbol_path_get(_edje_module_init, "/edje/modules");
|
|
||||||
/* 4. PREFIX/edje/modules/ */
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
paths[3] = strdup(PACKAGE_LIB_DIR "/edje/modules");
|
paths[1] = strdup(PACKAGE_LIB_DIR "/edje/modules");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (j = 0; j < ((sizeof (paths) / sizeof (char*)) - 1); ++j)
|
for (j = 0; j < ((sizeof (paths) / sizeof (char*)) - 1); ++j)
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <Eina.h>
|
#include <Eina.h>
|
||||||
#include <Ecore.h>
|
#include <Ecore.h>
|
||||||
#include <Eeze_Sensor.h>
|
#include <Eeze_Sensor.h>
|
||||||
|
@ -81,7 +82,7 @@ eeze_sensor_modules_load(void)
|
||||||
* is one of these items. We do load the modules from the builddir if the
|
* is one of these items. We do load the modules from the builddir if the
|
||||||
* environment is set. Normal case is to use installed modules from system
|
* environment is set. Normal case is to use installed modules from system
|
||||||
*/
|
*/
|
||||||
if (getenv("EFL_RUN_IN_TREE"))
|
if ((getuid() == getuid()) && (getenv("EFL_RUN_IN_TREE")))
|
||||||
{
|
{
|
||||||
const char **itr;
|
const char **itr;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
|
@ -276,10 +278,20 @@ efreet_dirs_init(void)
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
/* efreet_home_dir */
|
/* efreet_home_dir */
|
||||||
efreet_home_dir = getenv("HOME");
|
if (getuid() == getuid())
|
||||||
|
efreet_home_dir = getenv("HOME");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct passwd *pw = getpwent();
|
||||||
|
|
||||||
|
if ((pw) && (pw->pw_dir)) efreet_home_dir = pw->pw_dir;
|
||||||
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (!efreet_home_dir || efreet_home_dir[0] == '\0')
|
if (!efreet_home_dir || efreet_home_dir[0] == '\0')
|
||||||
efreet_home_dir = getenv("USERPROFILE");
|
{
|
||||||
|
if (getuid() == getuid())
|
||||||
|
efreet_home_dir = getenv("USERPROFILE");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!efreet_home_dir || efreet_home_dir[0] == '\0')
|
if (!efreet_home_dir || efreet_home_dir[0] == '\0')
|
||||||
efreet_home_dir = "/tmp";
|
efreet_home_dir = "/tmp";
|
||||||
|
@ -303,7 +315,7 @@ efreet_dirs_init(void)
|
||||||
xdg_config_dirs = efreet_dirs_get("XDG_CONFIG_DIRS", "/etc/xdg");
|
xdg_config_dirs = efreet_dirs_get("XDG_CONFIG_DIRS", "/etc/xdg");
|
||||||
|
|
||||||
/* xdg_runtime_dir */
|
/* xdg_runtime_dir */
|
||||||
xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
|
if (getuid() == getuid()) xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
|
||||||
if (!xdg_runtime_dir)
|
if (!xdg_runtime_dir)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "/tmp/xdg-XXXXXX");
|
snprintf(buf, sizeof(buf), "/tmp/xdg-XXXXXX");
|
||||||
|
@ -375,10 +387,10 @@ efreet_dirs_init(void)
|
||||||
static const char *
|
static const char *
|
||||||
efreet_dir_get(const char *key, const char *fallback)
|
efreet_dir_get(const char *key, const char *fallback)
|
||||||
{
|
{
|
||||||
char *dir;
|
char *dir = NULL;
|
||||||
const char *t;
|
const char *t;
|
||||||
|
|
||||||
dir = getenv(key);
|
if (getuid() == getuid()) dir = getenv(key);
|
||||||
if (!dir || dir[0] == '\0')
|
if (!dir || dir[0] == '\0')
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
@ -409,11 +421,11 @@ static Eina_List *
|
||||||
efreet_dirs_get(const char *key, const char *fallback)
|
efreet_dirs_get(const char *key, const char *fallback)
|
||||||
{
|
{
|
||||||
Eina_List *dirs = NULL;
|
Eina_List *dirs = NULL;
|
||||||
const char *path;
|
const char *path = NULL;
|
||||||
char *s, *p;
|
char *s, *p;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
path = getenv(key);
|
if (getuid() == getuid()) path = getenv(key);
|
||||||
if (!path || (path[0] == '\0')) path = fallback;
|
if (!path || (path[0] == '\0')) path = fallback;
|
||||||
|
|
||||||
if (!path) return dirs;
|
if (!path) return dirs;
|
||||||
|
@ -484,8 +496,11 @@ efreet_env_expand(const char *in)
|
||||||
{
|
{
|
||||||
memcpy(env, e1, len);
|
memcpy(env, e1, len);
|
||||||
env[len] = 0;
|
env[len] = 0;
|
||||||
val = getenv(env);
|
if (getuid() == getuid())
|
||||||
if (val) eina_strbuf_append(sb, val);
|
{
|
||||||
|
val = getenv(env);
|
||||||
|
if (val) eina_strbuf_append(sb, val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
e1 = NULL;
|
e1 = NULL;
|
||||||
eina_strbuf_append_char(sb, *p);
|
eina_strbuf_append_char(sb, *p);
|
||||||
|
|
|
@ -399,8 +399,9 @@ efreet_menu_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
efreet_menu_prefix = getenv("XDG_MENU_PREFIX");
|
if (getuid() == getuid())
|
||||||
if (!efreet_menu_prefix) efreet_menu_prefix = "";
|
efreet_menu_prefix = getenv("XDG_MENU_PREFIX");
|
||||||
|
if (!efreet_menu_prefix) efreet_menu_prefix = "";
|
||||||
|
|
||||||
efreet_menu_handle_cbs = eina_hash_string_superfast_new(NULL);
|
efreet_menu_handle_cbs = eina_hash_string_superfast_new(NULL);
|
||||||
efreet_menu_filter_cbs = eina_hash_string_superfast_new(NULL);
|
efreet_menu_filter_cbs = eina_hash_string_superfast_new(NULL);
|
||||||
|
|
|
@ -897,12 +897,12 @@ EAPI int
|
||||||
eina_file_mkstemp(const char *templatename, Eina_Tmpstr **path)
|
eina_file_mkstemp(const char *templatename, Eina_Tmpstr **path)
|
||||||
{
|
{
|
||||||
char buffer[PATH_MAX];
|
char buffer[PATH_MAX];
|
||||||
const char *tmpdir;
|
const char *tmpdir = NULL;
|
||||||
int fd;
|
int fd;
|
||||||
mode_t old_umask;
|
mode_t old_umask;
|
||||||
|
|
||||||
#ifndef HAVE_EVIL
|
#ifndef HAVE_EVIL
|
||||||
tmpdir = getenv("TMPDIR");
|
if (getuid() == getuid()) tmpdir = getenv("TMPDIR");
|
||||||
if (!tmpdir) tmpdir = "/tmp";
|
if (!tmpdir) tmpdir = "/tmp";
|
||||||
#else
|
#else
|
||||||
tmpdir = (char *)evil_tmpdir_get();
|
tmpdir = (char *)evil_tmpdir_get();
|
||||||
|
@ -929,11 +929,11 @@ EAPI Eina_Bool
|
||||||
eina_file_mkdtemp(const char *templatename, Eina_Tmpstr **path)
|
eina_file_mkdtemp(const char *templatename, Eina_Tmpstr **path)
|
||||||
{
|
{
|
||||||
char buffer[PATH_MAX];
|
char buffer[PATH_MAX];
|
||||||
const char *tmpdir;
|
const char *tmpdir = NULL;
|
||||||
char *tmpdirname;
|
char *tmpdirname;
|
||||||
|
|
||||||
#ifndef HAVE_EVIL
|
#ifndef HAVE_EVIL
|
||||||
tmpdir = getenv("TMPDIR");
|
if (getuid() == getuid()) tmpdir = getenv("TMPDIR");
|
||||||
if (!tmpdir) tmpdir = "/tmp";
|
if (!tmpdir) tmpdir = "/tmp";
|
||||||
#else
|
#else
|
||||||
tmpdir = (char *)evil_tmpdir_get();
|
tmpdir = (char *)evil_tmpdir_get();
|
||||||
|
|
|
@ -176,17 +176,6 @@ eina_mempool_init(void)
|
||||||
PACKAGE_LIB_DIR "/eina/modules/mp",
|
PACKAGE_LIB_DIR "/eina/modules/mp",
|
||||||
MODULE_ARCH);
|
MODULE_ARCH);
|
||||||
|
|
||||||
path = eina_module_environment_path_get("HOME", "/.eina/mp/modules/mp");
|
|
||||||
_modules = eina_module_arch_list_get(_modules, path, MODULE_ARCH);
|
|
||||||
if (path)
|
|
||||||
free(path);
|
|
||||||
|
|
||||||
path = eina_module_environment_path_get("EINA_MODULES_MEMPOOL_DIR",
|
|
||||||
"/eina/modules/mp");
|
|
||||||
_modules = eina_module_arch_list_get(_modules, path, MODULE_ARCH);
|
|
||||||
if (path)
|
|
||||||
free(path);
|
|
||||||
|
|
||||||
path = eina_module_symbol_path_get((const void *)eina_init,
|
path = eina_module_symbol_path_get((const void *)eina_init,
|
||||||
"/eina/modules/mp");
|
"/eina/modules/mp");
|
||||||
_modules = eina_module_arch_list_get(_modules, path, MODULE_ARCH);
|
_modules = eina_module_arch_list_get(_modules, path, MODULE_ARCH);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef HAVE_DLOPEN
|
#ifdef HAVE_DLOPEN
|
||||||
# include <dlfcn.h>
|
# include <dlfcn.h>
|
||||||
|
@ -430,6 +431,7 @@ EAPI char *eina_module_environment_path_get(const char *env,
|
||||||
const char *env_dir;
|
const char *env_dir;
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(env, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(env, NULL);
|
||||||
|
if (getuid() != getuid()) return NULL; // if setuid dont use dangerous env
|
||||||
|
|
||||||
env_dir = getenv(env);
|
env_dir = getenv(env);
|
||||||
if (env_dir)
|
if (env_dir)
|
||||||
|
|
|
@ -335,6 +335,7 @@ _try_argv(Eina_Prefix *pfx, const char *argv0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 3. argv0 no path - look in PATH */
|
/* 3. argv0 no path - look in PATH */
|
||||||
|
if (getuid() != getuid()) return 0;
|
||||||
path = getenv("PATH");
|
path = getenv("PATH");
|
||||||
if (!path)
|
if (!path)
|
||||||
{
|
{
|
||||||
|
@ -383,6 +384,7 @@ _get_env_var(char **var, const char *envprefix, const char *envsuffix, const cha
|
||||||
char env[1024];
|
char env[1024];
|
||||||
const char *s;
|
const char *s;
|
||||||
|
|
||||||
|
if (getuid() != getuid()) return 0;
|
||||||
snprintf(env, sizeof(env), "%s_%s_DIR", envprefix, envsuffix);
|
snprintf(env, sizeof(env), "%s_%s_DIR", envprefix, envsuffix);
|
||||||
s = getenv(env);
|
s = getenv(env);
|
||||||
if (s)
|
if (s)
|
||||||
|
@ -418,13 +420,16 @@ _get_env_vars(Eina_Prefix *pfx,
|
||||||
const char *prefix;
|
const char *prefix;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
snprintf(env, sizeof(env), "%s_PREFIX", envprefix);
|
if (getuid() == getuid())
|
||||||
if ((prefix = getenv(env))) STRDUP_REP(pfx->prefix_path, prefix);
|
{
|
||||||
|
snprintf(env, sizeof(env), "%s_PREFIX", envprefix);
|
||||||
|
if ((prefix = getenv(env))) STRDUP_REP(pfx->prefix_path, prefix);
|
||||||
|
|
||||||
ret += _get_env_var(&pfx->prefix_path_bin, envprefix, "BIN", prefix, bindir);
|
ret += _get_env_var(&pfx->prefix_path_bin, envprefix, "BIN", prefix, bindir);
|
||||||
ret += _get_env_var(&pfx->prefix_path_lib, envprefix, "LIB", prefix, libdir);
|
ret += _get_env_var(&pfx->prefix_path_lib, envprefix, "LIB", prefix, libdir);
|
||||||
ret += _get_env_var(&pfx->prefix_path_data, envprefix, "DATA", prefix, datadir);
|
ret += _get_env_var(&pfx->prefix_path_data, envprefix, "DATA", prefix, datadir);
|
||||||
ret += _get_env_var(&pfx->prefix_path_locale, envprefix, "LOCALE", prefix, localedir);
|
ret += _get_env_var(&pfx->prefix_path_locale, envprefix, "LOCALE", prefix, localedir);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "emotion_private.h"
|
#include "emotion_private.h"
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef EMOTION_STATIC_BUILD_XINE
|
#ifdef EMOTION_STATIC_BUILD_XINE
|
||||||
Eina_Bool xine_module_init(void);
|
Eina_Bool xine_module_init(void);
|
||||||
|
@ -53,55 +54,42 @@ static void
|
||||||
_emotion_modules_load(void)
|
_emotion_modules_load(void)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
char *path;
|
|
||||||
|
|
||||||
if (_emotion_modules_loaded) return;
|
if (_emotion_modules_loaded) return;
|
||||||
_emotion_modules_loaded = EINA_TRUE;
|
_emotion_modules_loaded = EINA_TRUE;
|
||||||
|
|
||||||
if (getenv("EFL_RUN_IN_TREE"))
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
struct stat st;
|
if (getenv("EFL_RUN_IN_TREE"))
|
||||||
snprintf(buf, sizeof(buf), "%s/src/modules/emotion",
|
|
||||||
PACKAGE_BUILD_DIR);
|
|
||||||
if (stat(buf, &st) == 0)
|
|
||||||
{
|
{
|
||||||
const char *built_modules[] = {
|
struct stat st;
|
||||||
|
snprintf(buf, sizeof(buf), "%s/src/modules/emotion",
|
||||||
|
PACKAGE_BUILD_DIR);
|
||||||
|
if (stat(buf, &st) == 0)
|
||||||
|
{
|
||||||
|
const char *built_modules[] = {
|
||||||
#ifdef EMOTION_BUILD_GSTREAMER
|
#ifdef EMOTION_BUILD_GSTREAMER
|
||||||
"gstreamer",
|
"gstreamer",
|
||||||
#endif
|
#endif
|
||||||
#ifdef EMOTION_BUILD_XINE
|
#ifdef EMOTION_BUILD_XINE
|
||||||
"xine",
|
"xine",
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
const char **itr;
|
const char **itr;
|
||||||
for (itr = built_modules; *itr != NULL; itr++)
|
for (itr = built_modules; *itr != NULL; itr++)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"%s/src/modules/emotion/%s/.libs",
|
"%s/src/modules/emotion/%s/.libs",
|
||||||
PACKAGE_BUILD_DIR, *itr);
|
PACKAGE_BUILD_DIR, *itr);
|
||||||
_emotion_modules = eina_module_list_get(_emotion_modules, buf,
|
_emotion_modules = eina_module_list_get(_emotion_modules, buf,
|
||||||
EINA_FALSE, NULL, NULL);
|
EINA_FALSE, NULL, NULL);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path = eina_module_environment_path_get("EMOTION_MODULES_DIR",
|
|
||||||
"/emotion/modules");
|
|
||||||
if (path)
|
|
||||||
{
|
|
||||||
_emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
|
|
||||||
free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
path = eina_module_environment_path_get("HOME", "/.emotion");
|
|
||||||
if (path)
|
|
||||||
{
|
|
||||||
_emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
|
|
||||||
free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/emotion/modules", eina_prefix_lib_get(_emotion_pfx));
|
snprintf(buf, sizeof(buf), "%s/emotion/modules", eina_prefix_lib_get(_emotion_pfx));
|
||||||
_emotion_modules = eina_module_arch_list_get(_emotion_modules, buf, MODULE_ARCH);
|
_emotion_modules = eina_module_arch_list_get(_emotion_modules, buf, MODULE_ARCH);
|
||||||
// no - this is dumb. load ALL modules we find - force ALL the code pages of
|
// no - this is dumb. load ALL modules we find - force ALL the code pages of
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
|
||||||
#ifdef HAVE_XATTR
|
#ifdef HAVE_XATTR
|
||||||
# include <sys/xattr.h>
|
# include <sys/xattr.h>
|
||||||
|
@ -154,50 +155,37 @@ static void
|
||||||
_ethumb_plugins_load(void)
|
_ethumb_plugins_load(void)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
char *path;
|
|
||||||
|
|
||||||
if (_plugins_loaded) return;
|
if (_plugins_loaded) return;
|
||||||
_plugins_loaded = EINA_TRUE;
|
_plugins_loaded = EINA_TRUE;
|
||||||
|
|
||||||
if (getenv("EFL_RUN_IN_TREE"))
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
struct stat st;
|
if (getenv("EFL_RUN_IN_TREE"))
|
||||||
snprintf(buf, sizeof(buf), "%s/src/modules/ethumb",
|
|
||||||
PACKAGE_BUILD_DIR);
|
|
||||||
if (stat(buf, &st) == 0)
|
|
||||||
{
|
{
|
||||||
const char *built_modules[] = {
|
struct stat st;
|
||||||
"emotion",
|
snprintf(buf, sizeof(buf), "%s/src/modules/ethumb",
|
||||||
NULL
|
PACKAGE_BUILD_DIR);
|
||||||
};
|
if (stat(buf, &st) == 0)
|
||||||
const char **itr;
|
|
||||||
for (itr = built_modules; *itr != NULL; itr++)
|
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf),
|
const char *built_modules[] = {
|
||||||
"%s/src/modules/ethumb/%s/.libs",
|
"emotion",
|
||||||
PACKAGE_BUILD_DIR, *itr);
|
NULL
|
||||||
_plugins = eina_module_list_get(_plugins, buf,
|
};
|
||||||
EINA_FALSE, NULL, NULL);
|
const char **itr;
|
||||||
|
for (itr = built_modules; *itr != NULL; itr++)
|
||||||
|
{
|
||||||
|
snprintf(buf, sizeof(buf),
|
||||||
|
"%s/src/modules/ethumb/%s/.libs",
|
||||||
|
PACKAGE_BUILD_DIR, *itr);
|
||||||
|
_plugins = eina_module_list_get(_plugins, buf,
|
||||||
|
EINA_FALSE, NULL, NULL);
|
||||||
|
}
|
||||||
|
goto load;
|
||||||
}
|
}
|
||||||
goto load;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path = eina_module_environment_path_get("ETHUMB_MODULES_DIR",
|
|
||||||
"/ethumb/modules");
|
|
||||||
if (path)
|
|
||||||
{
|
|
||||||
_plugins = eina_module_arch_list_get(_plugins, path, MODULE_ARCH);
|
|
||||||
free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
path = eina_module_environment_path_get("HOME", "/.ethumb");
|
|
||||||
if (path)
|
|
||||||
{
|
|
||||||
_plugins = eina_module_arch_list_get(_plugins, path, MODULE_ARCH);
|
|
||||||
free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/ethumb/modules", eina_prefix_lib_get(_pfx));
|
snprintf(buf, sizeof(buf), "%s/ethumb/modules", eina_prefix_lib_get(_pfx));
|
||||||
_plugins = eina_module_arch_list_get(_plugins, buf, MODULE_ARCH);
|
_plugins = eina_module_arch_list_get(_plugins, buf, MODULE_ARCH);
|
||||||
|
|
||||||
|
@ -269,8 +257,18 @@ ethumb_init(void)
|
||||||
ecore_evas_init();
|
ecore_evas_init();
|
||||||
edje_init();
|
edje_init();
|
||||||
|
|
||||||
home = getenv("HOME");
|
if (getuid() == getuid())
|
||||||
snprintf(buf, sizeof(buf), "%s/.thumbnails", home);
|
{
|
||||||
|
home = getenv("HOME");
|
||||||
|
snprintf(buf, sizeof(buf), "%s/.thumbnails", home);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct passwd *pw = getpwent();
|
||||||
|
|
||||||
|
if ((!pw) || (!pw->pw_dir)) goto error_plugins_ext;
|
||||||
|
snprintf(buf, sizeof(buf), "%s/.thumbnails", pw->pw_dir);
|
||||||
|
}
|
||||||
|
|
||||||
_home_thumb_dir = eina_stringshare_add(buf);
|
_home_thumb_dir = eina_stringshare_add(buf);
|
||||||
_thumb_category_normal = eina_stringshare_add("normal");
|
_thumb_category_normal = eina_stringshare_add("normal");
|
||||||
|
@ -709,11 +707,21 @@ _ethumb_build_absolute_path(const char *path, char buf[PATH_MAX])
|
||||||
}
|
}
|
||||||
else if (path[0] == '~')
|
else if (path[0] == '~')
|
||||||
{
|
{
|
||||||
const char *home = getenv("HOME");
|
if (getuid() == getuid())
|
||||||
if (!home)
|
{
|
||||||
return NULL;
|
const char *home = getenv("HOME");
|
||||||
strncpy(p, home, PATH_MAX - 1);
|
if (!home) return NULL;
|
||||||
p[PATH_MAX - 1] = 0;
|
strncpy(p, home, PATH_MAX - 1);
|
||||||
|
p[PATH_MAX - 1] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct passwd *pw = getpwent();
|
||||||
|
|
||||||
|
if ((!pw) || (!pw->pw_dir)) return NULL;
|
||||||
|
strncpy(p, pw->pw_dir, PATH_MAX - 1);
|
||||||
|
p[PATH_MAX - 1] = 0;
|
||||||
|
}
|
||||||
len = strlen(p);
|
len = strlen(p);
|
||||||
p += len;
|
p += len;
|
||||||
p[0] = '/';
|
p[0] = '/';
|
||||||
|
|
|
@ -128,32 +128,38 @@ _socket_path_set(char *path)
|
||||||
char *env;
|
char *env;
|
||||||
char buf[UNIX_PATH_MAX];
|
char buf[UNIX_PATH_MAX];
|
||||||
|
|
||||||
env = getenv("EVAS_CSERVE2_SOCKET");
|
if (getuid() == getuid())
|
||||||
if (env && env[0])
|
|
||||||
{
|
{
|
||||||
eina_strlcpy(path, env, UNIX_PATH_MAX);
|
env = getenv("EVAS_CSERVE2_SOCKET");
|
||||||
return;
|
if (env && env[0])
|
||||||
|
{
|
||||||
|
eina_strlcpy(path, env, UNIX_PATH_MAX);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "/tmp/.evas-cserve2-%x.socket", (int)getuid());
|
snprintf(buf, sizeof(buf), "/tmp/.evas-cserve2-%x.socket", (int)getuid());
|
||||||
/* FIXME: check we can actually create this socket */
|
/* FIXME: check we can actually create this socket */
|
||||||
strcpy(path, buf);
|
strcpy(path, buf);
|
||||||
#if 0
|
#if 0
|
||||||
env = getenv("XDG_RUNTIME_DIR");
|
if (getuid() == getuid())
|
||||||
if (!env || !env[0])
|
|
||||||
{
|
{
|
||||||
env = getenv("HOME");
|
env = getenv("XDG_RUNTIME_DIR");
|
||||||
if (!env || !env[0])
|
if (!env || !env[0])
|
||||||
{
|
{
|
||||||
env = getenv("TMPDIR");
|
env = getenv("HOME");
|
||||||
if (!env || !env[0])
|
if (!env || !env[0])
|
||||||
env = "/tmp";
|
{
|
||||||
|
env = getenv("TMPDIR");
|
||||||
|
if (!env || !env[0])
|
||||||
|
env = "/tmp";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/evas-cserve2-%x.socket", env, getuid());
|
snprintf(buf, sizeof(buf), "%s/evas-cserve2-%x.socket", env, getuid());
|
||||||
/* FIXME: check we can actually create this socket */
|
/* FIXME: check we can actually create this socket */
|
||||||
strcpy(path, buf);
|
strcpy(path, buf);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,29 +56,21 @@ evas_module_paths_init(void)
|
||||||
{
|
{
|
||||||
char *libdir, *path;
|
char *libdir, *path;
|
||||||
|
|
||||||
if (getenv("EFL_RUN_IN_TREE"))
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
struct stat st;
|
if (getenv("EFL_RUN_IN_TREE"))
|
||||||
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/evas";
|
|
||||||
if (stat(mp, &st) == 0)
|
|
||||||
{
|
{
|
||||||
evas_module_paths = _evas_module_append(evas_module_paths, strdup(mp));
|
struct stat st;
|
||||||
return;
|
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/evas";
|
||||||
|
if (stat(mp, &st) == 0)
|
||||||
|
{
|
||||||
|
evas_module_paths = _evas_module_append(evas_module_paths, strdup(mp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 1. ~/.evas/modules/ */
|
/* 1. libevas.so/../evas/modules/ */
|
||||||
path = eina_module_environment_path_get("HOME", "/.evas/modules");
|
|
||||||
evas_module_paths = _evas_module_append(evas_module_paths, path);
|
|
||||||
|
|
||||||
/* 2. $(EVAS_MODULE_DIR)/evas/modules/ */
|
|
||||||
path = eina_module_environment_path_get("EVAS_MODULES_DIR", "/evas/modules");
|
|
||||||
if (eina_list_search_unsorted(evas_module_paths, (Eina_Compare_Cb) strcmp, path))
|
|
||||||
free(path);
|
|
||||||
else
|
|
||||||
evas_module_paths = _evas_module_append(evas_module_paths, path);
|
|
||||||
|
|
||||||
/* 3. libevas.so/../evas/modules/ */
|
|
||||||
libdir = (char *)_evas_module_libdir_get();
|
libdir = (char *)_evas_module_libdir_get();
|
||||||
if (!libdir)
|
if (!libdir)
|
||||||
path = eina_module_symbol_path_get(evas_module_paths_init, "/evas/modules");
|
path = eina_module_symbol_path_get(evas_module_paths_init, "/evas/modules");
|
||||||
|
@ -96,7 +88,7 @@ evas_module_paths_init(void)
|
||||||
else
|
else
|
||||||
evas_module_paths = _evas_module_append(evas_module_paths, path);
|
evas_module_paths = _evas_module_append(evas_module_paths, path);
|
||||||
|
|
||||||
/* 4. PREFIX/lib/evas/modules/ */
|
/* 2. PREFIX/lib/evas/modules/ */
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
path = PACKAGE_LIB_DIR "/evas/modules";
|
path = PACKAGE_LIB_DIR "/evas/modules";
|
||||||
if (!eina_list_search_unsorted(evas_module_paths, (Eina_Compare_Cb) strcmp, path))
|
if (!eina_list_search_unsorted(evas_module_paths, (Eina_Compare_Cb) strcmp, path))
|
||||||
|
@ -334,12 +326,15 @@ evas_module_engine_list(void)
|
||||||
const char *fname = fi->path + fi->name_start;
|
const char *fname = fi->path + fi->name_start;
|
||||||
|
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
if (run_in_tree)
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/engines/%s/.libs",
|
if (run_in_tree)
|
||||||
s, fname);
|
{
|
||||||
if (!evas_file_path_exists(buf))
|
snprintf(buf, sizeof(buf), "%s/engines/%s/.libs",
|
||||||
buf[0] = '\0';
|
s, fname);
|
||||||
|
if (!evas_file_path_exists(buf))
|
||||||
|
buf[0] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf[0] == '\0')
|
if (buf[0] == '\0')
|
||||||
|
@ -430,12 +425,15 @@ evas_module_find_type(Evas_Module_Type type, const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer[0] = '\0';
|
buffer[0] = '\0';
|
||||||
if (run_in_tree)
|
if (getuid() == getuid())
|
||||||
{
|
{
|
||||||
snprintf(buffer, sizeof(buffer), "%s/%s/%s/.libs/%s",
|
if (run_in_tree)
|
||||||
path, type_str, name, EVAS_MODULE_NAME);
|
{
|
||||||
if (!evas_file_path_exists(buffer))
|
snprintf(buffer, sizeof(buffer), "%s/%s/%s/.libs/%s",
|
||||||
buffer[0] = '\0';
|
path, type_str, name, EVAS_MODULE_NAME);
|
||||||
|
if (!evas_file_path_exists(buffer))
|
||||||
|
buffer[0] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer[0] == '\0')
|
if (buffer[0] == '\0')
|
||||||
|
|
|
@ -40,10 +40,13 @@ _extnbuf_new(const char *base, int id, Eina_Bool sys, int num,
|
||||||
|
|
||||||
if (b->am_owner)
|
if (b->am_owner)
|
||||||
{
|
{
|
||||||
const char *s;
|
const char *s = NULL;
|
||||||
|
|
||||||
s = getenv("XDG_RUNTIME_DIR");
|
if (getuid() == getuid())
|
||||||
if (!s) s = getenv("TMPDIR");
|
{
|
||||||
|
s = getenv("XDG_RUNTIME_DIR");
|
||||||
|
if (!s) s = getenv("TMPDIR");
|
||||||
|
}
|
||||||
if (!s) s = "/tmp";
|
if (!s) s = "/tmp";
|
||||||
snprintf(file, sizeof(file), "%s/ee-lock-XXXXXX", s);
|
snprintf(file, sizeof(file), "%s/ee-lock-XXXXXX", s);
|
||||||
b->lockfd = mkstemp(file);
|
b->lockfd = mkstemp(file);
|
||||||
|
|
|
@ -1817,15 +1817,6 @@ static void
|
||||||
_players_load(void)
|
_players_load(void)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
const char *homedir = getenv("HOME");
|
|
||||||
|
|
||||||
if (homedir)
|
|
||||||
{
|
|
||||||
eina_str_join(buf, sizeof(buf), '/',
|
|
||||||
homedir,
|
|
||||||
".emotion/generic_players/" MODULE_ARCH);
|
|
||||||
_players_all_from(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
eina_str_join(buf, sizeof(buf), '/',
|
eina_str_join(buf, sizeof(buf), '/',
|
||||||
eina_prefix_lib_get(pfx),
|
eina_prefix_lib_get(pfx),
|
||||||
|
|
|
@ -1749,10 +1749,13 @@ _emotion_gstreamer_video_pipeline_parse(Emotion_Gstreamer_Video *ev,
|
||||||
|
|
||||||
/** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */
|
/** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */
|
||||||
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
||||||
if (getenv("EMOTION_GSTREAMER_DOT"))
|
if (getuid() == getuid())
|
||||||
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline),
|
{
|
||||||
GST_DEBUG_GRAPH_SHOW_ALL,
|
if (getenv("EMOTION_GSTREAMER_DOT"))
|
||||||
getenv("EMOTION_GSTREAMER_DOT"));
|
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline),
|
||||||
|
GST_DEBUG_GRAPH_SHOW_ALL,
|
||||||
|
getenv("EMOTION_GSTREAMER_DOT"));
|
||||||
|
}
|
||||||
|
|
||||||
if (!(res == GST_STATE_CHANGE_SUCCESS
|
if (!(res == GST_STATE_CHANGE_SUCCESS
|
||||||
|| res == GST_STATE_CHANGE_NO_PREROLL))
|
|| res == GST_STATE_CHANGE_NO_PREROLL))
|
||||||
|
|
|
@ -866,7 +866,10 @@ _emotion_gstreamer_cancel(void *data, Ecore_Thread *thread)
|
||||||
|
|
||||||
ev->threads = eina_list_remove(ev->threads, thread);
|
ev->threads = eina_list_remove(ev->threads, thread);
|
||||||
|
|
||||||
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
if (getuid() == getuid())
|
||||||
|
{
|
||||||
|
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
||||||
|
}
|
||||||
|
|
||||||
if (ev->in == ev->out && ev->delete_me)
|
if (ev->in == ev->out && ev->delete_me)
|
||||||
ev->api->del(ev);
|
ev->api->del(ev);
|
||||||
|
@ -885,7 +888,10 @@ _emotion_gstreamer_end(void *data, Ecore_Thread *thread)
|
||||||
ev->play_started = 1;
|
ev->play_started = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
if (getuid() == getuid())
|
||||||
|
{
|
||||||
|
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
||||||
|
}
|
||||||
|
|
||||||
if (ev->in == ev->out && ev->delete_me)
|
if (ev->in == ev->out && ev->delete_me)
|
||||||
ev->api->del(ev);
|
ev->api->del(ev);
|
||||||
|
@ -1427,7 +1433,10 @@ gstreamer_video_sink_new(Emotion_Gstreamer_Video *ev,
|
||||||
|
|
||||||
/** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */
|
/** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */
|
||||||
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
||||||
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(playbin), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
if (getuid() == getuid())
|
||||||
|
{
|
||||||
|
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(playbin), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
||||||
|
}
|
||||||
|
|
||||||
return playbin;
|
return playbin;
|
||||||
|
|
||||||
|
|
|
@ -1542,10 +1542,13 @@ _emotion_gstreamer_video_pipeline_parse(Emotion_Gstreamer_Video *ev,
|
||||||
|
|
||||||
/** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */
|
/** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */
|
||||||
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
||||||
if (getenv("EMOTION_GSTREAMER_DOT"))
|
if (getuid() == getuid())
|
||||||
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline),
|
{
|
||||||
GST_DEBUG_GRAPH_SHOW_ALL,
|
if (getenv("EMOTION_GSTREAMER_DOT"))
|
||||||
getenv("EMOTION_GSTREAMER_DOT"));
|
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline),
|
||||||
|
GST_DEBUG_GRAPH_SHOW_ALL,
|
||||||
|
getenv("EMOTION_GSTREAMER_DOT"));
|
||||||
|
}
|
||||||
|
|
||||||
if (!(res == GST_STATE_CHANGE_SUCCESS
|
if (!(res == GST_STATE_CHANGE_SUCCESS
|
||||||
|| res == GST_STATE_CHANGE_NO_PREROLL))
|
|| res == GST_STATE_CHANGE_NO_PREROLL))
|
||||||
|
@ -1626,7 +1629,10 @@ _emotion_gstreamer_cancel(void *data, Ecore_Thread *thread)
|
||||||
|
|
||||||
ev->threads = eina_list_remove(ev->threads, thread);
|
ev->threads = eina_list_remove(ev->threads, thread);
|
||||||
|
|
||||||
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
if (getuid() == getuid())
|
||||||
|
{
|
||||||
|
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
||||||
|
}
|
||||||
|
|
||||||
if (ev->in == ev->out && ev->delete_me)
|
if (ev->in == ev->out && ev->delete_me)
|
||||||
ev->api->del(ev);
|
ev->api->del(ev);
|
||||||
|
@ -1644,7 +1650,10 @@ _emotion_gstreamer_end(void *data, Ecore_Thread *thread)
|
||||||
gst_element_set_state(ev->pipeline, GST_STATE_PLAYING);
|
gst_element_set_state(ev->pipeline, GST_STATE_PLAYING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
if (getuid() == getuid())
|
||||||
|
{
|
||||||
|
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
||||||
|
}
|
||||||
|
|
||||||
if (ev->in == ev->out && ev->delete_me)
|
if (ev->in == ev->out && ev->delete_me)
|
||||||
ev->api->del(ev);
|
ev->api->del(ev);
|
||||||
|
@ -1754,7 +1763,10 @@ _create_pipeline (Emotion_Gstreamer_Video *ev,
|
||||||
|
|
||||||
/** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */
|
/** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */
|
||||||
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
||||||
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(playbin), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
if (getuid() == getuid())
|
||||||
|
{
|
||||||
|
if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(playbin), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT"));
|
||||||
|
}
|
||||||
|
|
||||||
return playbin;
|
return playbin;
|
||||||
|
|
||||||
|
|
|
@ -456,10 +456,8 @@ fb_init(int vt EINA_UNUSED, int device)
|
||||||
if (vt != 0) fb_setvt(vt);
|
if (vt != 0) fb_setvt(vt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( getenv("EVAS_FB_DEV") )
|
if ((getuid() == getuid()) && (getenv("EVAS_FB_DEV")))
|
||||||
{
|
fb = open(getenv("EVAS_FB_DEV"), O_RDWR);
|
||||||
fb = open(getenv("EVAS_FB_DEV"), O_RDWR);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(dev, "/dev/fb/%i", device);
|
sprintf(dev, "/dev/fb/%i", device);
|
||||||
|
|
|
@ -48,6 +48,7 @@ evas_gl_common_file_cache_mkpath(const char *path)
|
||||||
char ss[PATH_MAX];
|
char ss[PATH_MAX];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
if (getuid() != getuid()) return EINA_FALSE;
|
||||||
if (evas_gl_common_file_cache_is_dir(path)) return EINA_TRUE;
|
if (evas_gl_common_file_cache_is_dir(path)) return EINA_TRUE;
|
||||||
|
|
||||||
for (i = 0; path[i]; ss[i] = path[i], i++)
|
for (i = 0; path[i]; ss[i] = path[i], i++)
|
||||||
|
@ -70,6 +71,7 @@ evas_gl_common_file_cache_dir_check(char *cache_dir, int num)
|
||||||
char *home = NULL;
|
char *home = NULL;
|
||||||
char *subdir = ".cache/evas_gl_common_caches";
|
char *subdir = ".cache/evas_gl_common_caches";
|
||||||
|
|
||||||
|
if (getuid() != getuid()) return 0;
|
||||||
home = getenv("HOME");
|
home = getenv("HOME");
|
||||||
if ((!home) || (!home[0])) return 0;
|
if ((!home) || (!home[0])) return 0;
|
||||||
|
|
||||||
|
|
|
@ -1527,7 +1527,8 @@ eng_output_flush(void *data, Evas_Render_Mode render_mode)
|
||||||
// Save contents of the framebuffer to a file
|
// Save contents of the framebuffer to a file
|
||||||
if (swap_buffer_debug_mode == -1)
|
if (swap_buffer_debug_mode == -1)
|
||||||
{
|
{
|
||||||
if ((dname = getenv("EVAS_GL_SWAP_BUFFER_DEBUG_DIR")))
|
if ((getuid() == getuid()) &&
|
||||||
|
((dname = getenv("EVAS_GL_SWAP_BUFFER_DEBUG_DIR"))))
|
||||||
{
|
{
|
||||||
int stat;
|
int stat;
|
||||||
// Create a directory with 0775 permission
|
// Create a directory with 0775 permission
|
||||||
|
|
Loading…
Reference in New Issue