diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2020-04-22 12:49:34 +0100 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2020-04-22 12:51:50 +0100 |
commit | 56e2e21ae777434d718a262297a1e03cf2f565dc (patch) | |
tree | 0f267a2c1be5c5b46d4511f07f03bf8422bb6e66 /src/lib | |
parent | 53044bf10749ce5456df6cf1398834fc9ab3de84 (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | src/lib/ecore_file/ecore_file_path.c | 5 | ||||
-rw-r--r-- | src/lib/eina/eina_vpath.c | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/ecore_file/ecore_file_path.c b/src/lib/ecore_file/ecore_file_path.c index 0c4e466ce5..513f3b9a8a 100644 --- a/src/lib/ecore_file/ecore_file_path.c +++ b/src/lib/ecore_file/ecore_file_path.c | |||
@@ -95,7 +95,10 @@ ecore_file_app_installed(const char *exe) | |||
95 | char buf[PATH_MAX]; | 95 | char buf[PATH_MAX]; |
96 | 96 | ||
97 | if (!exe) return EINA_FALSE; | 97 | if (!exe) return EINA_FALSE; |
98 | if (ecore_file_can_exec(exe)) return EINA_TRUE; | 98 | if (((!strncmp(exe, "/", 1)) || |
99 | (!strncmp(exe, "./", 2)) || | ||
100 | (!strncmp(exe, "../", 3))) && | ||
101 | ecore_file_can_exec(exe)) return EINA_TRUE; | ||
99 | 102 | ||
100 | EINA_LIST_FOREACH(__ecore_file_path_bin, l, dir) | 103 | EINA_LIST_FOREACH(__ecore_file_path_bin, l, dir) |
101 | { | 104 | { |
diff --git a/src/lib/eina/eina_vpath.c b/src/lib/eina/eina_vpath.c index ac2d6ca9e2..871612c64e 100644 --- a/src/lib/eina/eina_vpath.c +++ b/src/lib/eina/eina_vpath.c | |||
@@ -50,12 +50,10 @@ static char * | |||
50 | _fallback_runtime_dir(const char *home) | 50 | _fallback_runtime_dir(const char *home) |
51 | { | 51 | { |
52 | char buf[PATH_MAX]; | 52 | char buf[PATH_MAX]; |
53 | #if defined(HAVE_GETUID) | ||
54 | uid_t uid = getuid(); | ||
55 | #endif | ||
56 | struct stat st; | 53 | struct stat st; |
57 | |||
58 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) | 54 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) |
55 | uid_t uid = getuid(); | ||
56 | |||
59 | if (setuid(geteuid()) != 0) | 57 | if (setuid(geteuid()) != 0) |
60 | { | 58 | { |
61 | fprintf(stderr, | 59 | fprintf(stderr, |