ecore_file - address issue about false positive of finding a file in ./

it may report an exe is installed if it happens to be in cwd but cwd
isnt in path. the "full/relative" path handling case mishandled this.
fixes T8678

@fix
This commit is contained in:
Carsten Haitzler 2020-04-22 12:49:34 +01:00
parent 53044bf107
commit 56e2e21ae7
2 changed files with 6 additions and 5 deletions

View File

@ -95,7 +95,10 @@ ecore_file_app_installed(const char *exe)
char buf[PATH_MAX];
if (!exe) return EINA_FALSE;
if (ecore_file_can_exec(exe)) return EINA_TRUE;
if (((!strncmp(exe, "/", 1)) ||
(!strncmp(exe, "./", 2)) ||
(!strncmp(exe, "../", 3))) &&
ecore_file_can_exec(exe)) return EINA_TRUE;
EINA_LIST_FOREACH(__ecore_file_path_bin, l, dir)
{

View File

@ -50,12 +50,10 @@ static char *
_fallback_runtime_dir(const char *home)
{
char buf[PATH_MAX];
#if defined(HAVE_GETUID)
uid_t uid = getuid();
#endif
struct stat st;
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
uid_t uid = getuid();
if (setuid(geteuid()) != 0)
{
fprintf(stderr,