forked from enlightenment/efl
fix mingw build for setuid fix/checks
This commit is contained in:
parent
b95ef3801f
commit
e8c13118eb
|
@ -544,6 +544,7 @@ mtrace \
|
|||
realpath \
|
||||
strlcpy \
|
||||
geteuid \
|
||||
getuid \
|
||||
])
|
||||
|
||||
AC_FUNC_ALLOCA
|
||||
|
|
|
@ -131,7 +131,9 @@ ecore_system_modules_load(void)
|
|||
{
|
||||
char buf[PATH_MAX] = "";
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
|
|
|
@ -1609,7 +1609,10 @@ _ecore_exe_exec_it(const char *exe_cmd,
|
|||
{
|
||||
if (!shell) /* Find users preferred shell. */
|
||||
{
|
||||
if (getuid() == getuid()) shell = getenv("SHELL");
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
shell = getenv("SHELL");
|
||||
if (!shell)
|
||||
shell = "/bin/sh";
|
||||
}
|
||||
|
|
|
@ -73,7 +73,9 @@ ecore_con_local_connect(Ecore_Con_Server *svr,
|
|||
|
||||
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
|
||||
{
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
homedir = getenv("XDG_RUNTIME_DIR");
|
||||
if (!homedir)
|
||||
|
@ -88,6 +90,7 @@ ecore_con_local_connect(Ecore_Con_Server *svr,
|
|||
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, svr->name,
|
||||
svr->port);
|
||||
}
|
||||
#if !defined(HAVE_GETUID) || defined(HAVE_GETEUID)
|
||||
else
|
||||
{
|
||||
struct passwd *pw = getpwent();
|
||||
|
@ -99,7 +102,7 @@ ecore_con_local_connect(Ecore_Con_Server *svr,
|
|||
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", pw->pw_dir, svr->name,
|
||||
svr->port);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
else if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_SYSTEM)
|
||||
{
|
||||
|
@ -218,7 +221,9 @@ ecore_con_local_listen(
|
|||
|
||||
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
|
||||
{
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
homedir = getenv("XDG_RUNTIME_DIR");
|
||||
if (!homedir)
|
||||
|
@ -231,6 +236,7 @@ ecore_con_local_listen(
|
|||
}
|
||||
}
|
||||
}
|
||||
#if !defined(HAVE_GETUID) || defined(HAVE_GETEUID)
|
||||
else
|
||||
{
|
||||
struct passwd *pw = getpwent();
|
||||
|
@ -238,7 +244,7 @@ ecore_con_local_listen(
|
|||
if ((!pw) || (!pw->pw_dir)) homedir = "/tmp";
|
||||
else homedir = pw->pw_dir;
|
||||
}
|
||||
|
||||
#endif
|
||||
mask = S_IRUSR | S_IWUSR | S_IXUSR;
|
||||
snprintf(buf, sizeof(buf), "%s/.ecore", homedir);
|
||||
if (stat(buf, &st) < 0)
|
||||
|
|
|
@ -596,7 +596,9 @@ ecore_con_socks_init(void)
|
|||
unsigned char addr6[sizeof(struct in6_addr)];
|
||||
#endif
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
/* ECORE_CON_SOCKS_V4=[user@]host-port:[1|0] */
|
||||
socks = getenv("ECORE_CON_SOCKS_V4");
|
||||
|
|
|
@ -39,7 +39,9 @@ _ecore_evas_engine_load(const char *engine)
|
|||
{
|
||||
char tmp[PATH_MAX] = "";
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (run_in_tree)
|
||||
{
|
||||
|
@ -81,7 +83,7 @@ _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(NULL);
|
||||
|
||||
if (getuid() == getuid())
|
||||
if (getuid() == geteuid())
|
||||
{
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
|
|
|
@ -108,7 +108,11 @@ _ecore_fb_size_get(int *w, int *h)
|
|||
struct fb_var_screeninfo fb_var;
|
||||
int fb;
|
||||
|
||||
if ((getuid() == getuid()) && (getenv("EVAS_FB_DEV")))
|
||||
if (
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
(getuid() == geteuid()) &&
|
||||
#endif
|
||||
(getenv("EVAS_FB_DEV")))
|
||||
fb = open(getenv("EVAS_FB_DEV"), O_RDWR);
|
||||
else
|
||||
{
|
||||
|
|
|
@ -81,7 +81,11 @@ ecore_fb_ts_init(void)
|
|||
{
|
||||
#ifdef HAVE_TSLIB
|
||||
char *tslib_tsdevice = NULL;
|
||||
if ((getuid() == getuid()) && ((tslib_tsdevice = getenv("TSLIB_TSDEVICE"))))
|
||||
if (
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
(getuid() == geteuid()) &&
|
||||
#endif
|
||||
((tslib_tsdevice = getenv("TSLIB_TSDEVICE"))))
|
||||
{
|
||||
printf( "ECORE_FB: TSLIB_TSDEVICE = '%s'\n", tslib_tsdevice );
|
||||
_ecore_fb_tslib_tsdev = ts_open( tslib_tsdevice, 1 ); /* 1 = nonblocking, 0 = blocking */
|
||||
|
|
|
@ -36,7 +36,9 @@ ecore_imf_module_init(void)
|
|||
"ECORE_IMF", "ecore_imf", "checkme",
|
||||
PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
|
||||
PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
|
|
|
@ -18,19 +18,9 @@ _ecore_xcb_xdefaults_init(void)
|
|||
|
||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||
|
||||
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 (getenv("HOME"))
|
||||
snprintf(buff, sizeof(buff), "%s/.Xdefaults", getenv("HOME"));
|
||||
else return;
|
||||
if ((_ecore_xcb_xdefaults_file = eina_file_open(buff, EINA_FALSE)))
|
||||
{
|
||||
eina_mmap_safety_enabled_set(EINA_TRUE);
|
||||
|
|
|
@ -6808,7 +6808,9 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
|
|||
#else
|
||||
# define BIN_EXT
|
||||
#endif
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
|
|
|
@ -37,7 +37,9 @@ _edje_module_handle_load(const char *module)
|
|||
{
|
||||
char tmp[PATH_MAX] = "";
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (run_in_tree)
|
||||
{
|
||||
|
@ -77,7 +79,9 @@ _edje_module_init(void)
|
|||
|
||||
_registered_modules = eina_hash_string_small_new(EINA_FREE_CB(eina_module_free));
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
|
|
|
@ -82,7 +82,11 @@ eeze_sensor_modules_load(void)
|
|||
* 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
|
||||
*/
|
||||
if ((getuid() == getuid()) && (getenv("EFL_RUN_IN_TREE")))
|
||||
if (
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
(getuid() == geteuid()) &&
|
||||
#endif
|
||||
(getenv("EFL_RUN_IN_TREE")))
|
||||
{
|
||||
const char **itr;
|
||||
|
||||
|
|
|
@ -278,18 +278,24 @@ efreet_dirs_init(void)
|
|||
struct stat st;
|
||||
|
||||
/* efreet_home_dir */
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
efreet_home_dir = getenv("HOME");
|
||||
#if !defined(HAVE_GETUID) || defined(HAVE_GETEUID)
|
||||
else
|
||||
{
|
||||
struct passwd *pw = getpwent();
|
||||
|
||||
if ((pw) && (pw->pw_dir)) efreet_home_dir = pw->pw_dir;
|
||||
}
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
if (!efreet_home_dir || efreet_home_dir[0] == '\0')
|
||||
{
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
efreet_home_dir = getenv("USERPROFILE");
|
||||
}
|
||||
#endif
|
||||
|
@ -315,7 +321,10 @@ efreet_dirs_init(void)
|
|||
xdg_config_dirs = efreet_dirs_get("XDG_CONFIG_DIRS", "/etc/xdg");
|
||||
|
||||
/* xdg_runtime_dir */
|
||||
if (getuid() == getuid()) xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
|
||||
if (!xdg_runtime_dir)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "/tmp/xdg-XXXXXX");
|
||||
|
@ -390,7 +399,10 @@ efreet_dir_get(const char *key, const char *fallback)
|
|||
char *dir = NULL;
|
||||
const char *t;
|
||||
|
||||
if (getuid() == getuid()) dir = getenv(key);
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
dir = getenv(key);
|
||||
if (!dir || dir[0] == '\0')
|
||||
{
|
||||
int len;
|
||||
|
@ -425,7 +437,10 @@ efreet_dirs_get(const char *key, const char *fallback)
|
|||
char *s, *p;
|
||||
size_t len;
|
||||
|
||||
if (getuid() == getuid()) path = getenv(key);
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
path = getenv(key);
|
||||
if (!path || (path[0] == '\0')) path = fallback;
|
||||
|
||||
if (!path) return dirs;
|
||||
|
@ -496,7 +511,9 @@ efreet_env_expand(const char *in)
|
|||
{
|
||||
memcpy(env, e1, len);
|
||||
env[len] = 0;
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
val = getenv(env);
|
||||
if (val) eina_strbuf_append(sb, val);
|
||||
|
|
|
@ -14,6 +14,7 @@ static int _efreet_menu_log_dom = -1;
|
|||
#include "Efreet.h"
|
||||
#include "efreet_private.h"
|
||||
#include "efreet_xml.h"
|
||||
#include <unistd.h>
|
||||
|
||||
typedef struct Efreet_Menu_Move Efreet_Menu_Move;
|
||||
|
||||
|
@ -399,7 +400,9 @@ efreet_menu_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
efreet_menu_prefix = getenv("XDG_MENU_PREFIX");
|
||||
if (!efreet_menu_prefix) efreet_menu_prefix = "";
|
||||
|
||||
|
|
|
@ -902,7 +902,10 @@ eina_file_mkstemp(const char *templatename, Eina_Tmpstr **path)
|
|||
mode_t old_umask;
|
||||
|
||||
#ifndef HAVE_EVIL
|
||||
if (getuid() == getuid()) tmpdir = getenv("TMPDIR");
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
tmpdir = getenv("TMPDIR");
|
||||
if (!tmpdir) tmpdir = "/tmp";
|
||||
#else
|
||||
tmpdir = (char *)evil_tmpdir_get();
|
||||
|
@ -933,7 +936,10 @@ eina_file_mkdtemp(const char *templatename, Eina_Tmpstr **path)
|
|||
char *tmpdirname;
|
||||
|
||||
#ifndef HAVE_EVIL
|
||||
if (getuid() == getuid()) tmpdir = getenv("TMPDIR");
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
tmpdir = getenv("TMPDIR");
|
||||
if (!tmpdir) tmpdir = "/tmp";
|
||||
#else
|
||||
tmpdir = (char *)evil_tmpdir_get();
|
||||
|
|
|
@ -431,8 +431,9 @@ EAPI char *eina_module_environment_path_get(const char *env,
|
|||
const char *env_dir;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(env, NULL);
|
||||
if (getuid() != getuid()) return NULL; // if setuid dont use dangerous env
|
||||
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() != geteuid()) return NULL; // if setuid dont use dangerous env
|
||||
#endif
|
||||
env_dir = getenv(env);
|
||||
if (env_dir)
|
||||
{
|
||||
|
|
|
@ -335,7 +335,9 @@ _try_argv(Eina_Prefix *pfx, const char *argv0)
|
|||
}
|
||||
|
||||
/* 3. argv0 no path - look in PATH */
|
||||
if (getuid() != getuid()) return 0;
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() != geteuid()) return 0;
|
||||
#endif
|
||||
path = getenv("PATH");
|
||||
if (!path)
|
||||
{
|
||||
|
@ -384,7 +386,9 @@ _get_env_var(char **var, const char *envprefix, const char *envsuffix, const cha
|
|||
char env[1024];
|
||||
const char *s;
|
||||
|
||||
if (getuid() != getuid()) return 0;
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() != geteuid()) return 0;
|
||||
#endif
|
||||
snprintf(env, sizeof(env), "%s_%s_DIR", envprefix, envsuffix);
|
||||
s = getenv(env);
|
||||
if (s)
|
||||
|
@ -420,7 +424,9 @@ _get_env_vars(Eina_Prefix *pfx,
|
|||
const char *prefix;
|
||||
int ret = 0;
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
snprintf(env, sizeof(env), "%s_PREFIX", envprefix);
|
||||
if ((prefix = getenv(env))) STRDUP_REP(pfx->prefix_path, prefix);
|
||||
|
|
|
@ -58,7 +58,9 @@ _emotion_modules_load(void)
|
|||
if (_emotion_modules_loaded) return;
|
||||
_emotion_modules_loaded = EINA_TRUE;
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
|
|
|
@ -159,7 +159,9 @@ _ethumb_plugins_load(void)
|
|||
if (_plugins_loaded) return;
|
||||
_plugins_loaded = EINA_TRUE;
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
|
@ -257,11 +259,14 @@ ethumb_init(void)
|
|||
ecore_evas_init();
|
||||
edje_init();
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
home = getenv("HOME");
|
||||
snprintf(buf, sizeof(buf), "%s/.thumbnails", home);
|
||||
}
|
||||
#if !defined(HAVE_GETUID) || defined(HAVE_GETEUID)
|
||||
else
|
||||
{
|
||||
struct passwd *pw = getpwent();
|
||||
|
@ -269,6 +274,7 @@ ethumb_init(void)
|
|||
if ((!pw) || (!pw->pw_dir)) goto error_plugins_ext;
|
||||
snprintf(buf, sizeof(buf), "%s/.thumbnails", pw->pw_dir);
|
||||
}
|
||||
#endif
|
||||
|
||||
_home_thumb_dir = eina_stringshare_add(buf);
|
||||
_thumb_category_normal = eina_stringshare_add("normal");
|
||||
|
@ -707,13 +713,16 @@ _ethumb_build_absolute_path(const char *path, char buf[PATH_MAX])
|
|||
}
|
||||
else if (path[0] == '~')
|
||||
{
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
const char *home = getenv("HOME");
|
||||
if (!home) return NULL;
|
||||
strncpy(p, home, PATH_MAX - 1);
|
||||
p[PATH_MAX - 1] = 0;
|
||||
}
|
||||
#if !defined(HAVE_GETUID) || defined(HAVE_GETEUID)
|
||||
else
|
||||
{
|
||||
struct passwd *pw = getpwent();
|
||||
|
@ -722,6 +731,7 @@ _ethumb_build_absolute_path(const char *path, char buf[PATH_MAX])
|
|||
strncpy(p, pw->pw_dir, PATH_MAX - 1);
|
||||
p[PATH_MAX - 1] = 0;
|
||||
}
|
||||
#endif
|
||||
len = strlen(p);
|
||||
p += len;
|
||||
p[0] = '/';
|
||||
|
|
|
@ -128,7 +128,9 @@ _socket_path_set(char *path)
|
|||
char *env;
|
||||
char buf[UNIX_PATH_MAX];
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
env = getenv("EVAS_CSERVE2_SOCKET");
|
||||
if (env && env[0])
|
||||
|
@ -142,7 +144,9 @@ _socket_path_set(char *path)
|
|||
/* FIXME: check we can actually create this socket */
|
||||
strcpy(path, buf);
|
||||
#if 0
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
env = getenv("XDG_RUNTIME_DIR");
|
||||
if (!env || !env[0])
|
||||
|
|
|
@ -56,7 +56,9 @@ evas_module_paths_init(void)
|
|||
{
|
||||
char *libdir, *path;
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
|
@ -326,7 +328,9 @@ evas_module_engine_list(void)
|
|||
const char *fname = fi->path + fi->name_start;
|
||||
|
||||
buf[0] = '\0';
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (run_in_tree)
|
||||
{
|
||||
|
@ -425,7 +429,9 @@ evas_module_find_type(Evas_Module_Type type, const char *name)
|
|||
}
|
||||
|
||||
buffer[0] = '\0';
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (run_in_tree)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,9 @@ _extnbuf_new(const char *base, int id, Eina_Bool sys, int num,
|
|||
{
|
||||
const char *s = NULL;
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
s = getenv("XDG_RUNTIME_DIR");
|
||||
if (!s) s = getenv("TMPDIR");
|
||||
|
|
|
@ -1749,7 +1749,9 @@ _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' */
|
||||
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (getenv("EMOTION_GSTREAMER_DOT"))
|
||||
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline),
|
||||
|
|
|
@ -866,7 +866,9 @@ _emotion_gstreamer_cancel(void *data, Ecore_Thread *thread)
|
|||
|
||||
ev->threads = eina_list_remove(ev->threads, thread);
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
@ -888,7 +890,9 @@ _emotion_gstreamer_end(void *data, Ecore_Thread *thread)
|
|||
ev->play_started = 1;
|
||||
}
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
@ -1433,7 +1437,9 @@ 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' */
|
||||
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
|
|
@ -1542,7 +1542,9 @@ _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' */
|
||||
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
if (getenv("EMOTION_GSTREAMER_DOT"))
|
||||
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline),
|
||||
|
@ -1629,7 +1631,9 @@ _emotion_gstreamer_cancel(void *data, Ecore_Thread *thread)
|
|||
|
||||
ev->threads = eina_list_remove(ev->threads, thread);
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
@ -1650,7 +1654,9 @@ _emotion_gstreamer_end(void *data, Ecore_Thread *thread)
|
|||
gst_element_set_state(ev->pipeline, GST_STATE_PLAYING);
|
||||
}
|
||||
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
@ -1763,7 +1769,9 @@ _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' */
|
||||
/** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */
|
||||
if (getuid() == getuid())
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() == geteuid())
|
||||
#endif
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
|
|
@ -456,7 +456,11 @@ fb_init(int vt EINA_UNUSED, int device)
|
|||
if (vt != 0) fb_setvt(vt);
|
||||
#endif
|
||||
|
||||
if ((getuid() == getuid()) && (getenv("EVAS_FB_DEV")))
|
||||
if (
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
(getuid() == geteuid()) &&
|
||||
#endif
|
||||
(getenv("EVAS_FB_DEV")))
|
||||
fb = open(getenv("EVAS_FB_DEV"), O_RDWR);
|
||||
else
|
||||
{
|
||||
|
|
|
@ -48,7 +48,9 @@ evas_gl_common_file_cache_mkpath(const char *path)
|
|||
char ss[PATH_MAX];
|
||||
unsigned int i;
|
||||
|
||||
if (getuid() != getuid()) return EINA_FALSE;
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() != geteuid()) return EINA_FALSE;
|
||||
#endif
|
||||
if (evas_gl_common_file_cache_is_dir(path)) return EINA_TRUE;
|
||||
|
||||
for (i = 0; path[i]; ss[i] = path[i], i++)
|
||||
|
@ -71,7 +73,9 @@ evas_gl_common_file_cache_dir_check(char *cache_dir, int num)
|
|||
char *home = NULL;
|
||||
char *subdir = ".cache/evas_gl_common_caches";
|
||||
|
||||
if (getuid() != getuid()) return 0;
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
if (getuid() != geteuid()) return 0;
|
||||
#endif
|
||||
home = getenv("HOME");
|
||||
if ((!home) || (!home[0])) return 0;
|
||||
|
||||
|
|
|
@ -1527,7 +1527,10 @@ eng_output_flush(void *data, Evas_Render_Mode render_mode)
|
|||
// Save contents of the framebuffer to a file
|
||||
if (swap_buffer_debug_mode == -1)
|
||||
{
|
||||
if ((getuid() == getuid()) &&
|
||||
if (
|
||||
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
|
||||
(getuid() == geteuid()) &&
|
||||
#endif
|
||||
((dname = getenv("EVAS_GL_SWAP_BUFFER_DEBUG_DIR"))))
|
||||
{
|
||||
int stat;
|
||||
|
|
Loading…
Reference in New Issue