aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore/ecore.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-01-08 19:46:23 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-01-08 19:46:23 +0900
commitb95ef3801f9719a8f8ff731e25d66a8d1dd417cd (patch)
tree258548da51b18d5fde17915bdc36cba44effcf40 /src/lib/ecore/ecore.c
parenteio - protect against posible segv on rename with eio (diff)
downloadefl-b95ef3801f9719a8f8ff731e25d66a8d1dd417cd.tar.gz
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.
Diffstat (limited to 'src/lib/ecore/ecore.c')
-rw-r--r--src/lib/ecore/ecore.c63
1 files changed, 25 insertions, 38 deletions
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 3477aca4ad..d81cc6b16f 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -130,55 +130,42 @@ static void
ecore_system_modules_load(void)
{
char buf[PATH_MAX] = "";
- char *path;
- if (getenv("EFL_RUN_IN_TREE"))
+ if (getuid() == getuid())
{
- struct stat st;
- snprintf(buf, sizeof(buf), "%s/src/modules/ecore/system",
- PACKAGE_BUILD_DIR);
- if (stat(buf, &st) == 0)
+ if (getenv("EFL_RUN_IN_TREE"))
{
- 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
- "systemd",
+ "systemd",
#endif
#ifdef HAVE_TIZEN_CONFIGURATION_MANAGER
- "tizen",
+ "tizen",
#endif
- NULL
- };
- const char **itr;
- for (itr = built_modules; *itr != NULL; itr++)
- {
- snprintf(buf, sizeof(buf),
- "%s/src/modules/ecore/system/%s/.libs",
- PACKAGE_BUILD_DIR, *itr);
- module_list = eina_module_list_get(module_list, buf,
- EINA_FALSE, NULL, NULL);
+ NULL
+ };
+ const char **itr;
+ for (itr = built_modules; *itr != NULL; itr++)
+ {
+ snprintf(buf, sizeof(buf),
+ "%s/src/modules/ecore/system/%s/.libs",
+ PACKAGE_BUILD_DIR, *itr);
+ module_list = eina_module_list_get(module_list, buf,
+ 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",
eina_prefix_lib_get(_ecore_pfx));
module_list = eina_module_arch_list_get(module_list, buf, MODULE_ARCH);