forked from enlightenment/enlightenment
e_fm: fix symlink access bug
Summary: There was no checking about absolute path of symbolic link In case of symbolic link, use real link (absolute path) and set sd->dev as "/" Fixes T1365 Reviewers: raster, zmike CC: seoz, cedric Maniphest Tasks: T1365 Differential Revision: https://phab.enlightenment.org/D1147
This commit is contained in:
parent
1a11067c32
commit
e2bf6f4427
|
@ -535,28 +535,11 @@ _e_fm2_icon_path(const E_Fm2_Icon *ic, char *buf, int buflen)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (ic->info.link)
|
if (ic->info.real_link)
|
||||||
{
|
r = snprintf(buf, buflen, "%s", ic->info.real_link);
|
||||||
if (ic->info.link[0] == '/')
|
|
||||||
r = snprintf(buf, buflen, "%s", ic->info.link);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char *tmp;
|
|
||||||
|
|
||||||
r = snprintf(buf, buflen, "%s/%s", ic->sd->path, ic->info.file);
|
|
||||||
if (!ic->sd->dev)
|
|
||||||
{
|
|
||||||
tmp = ecore_file_realpath(buf);
|
|
||||||
if (tmp)
|
|
||||||
{
|
|
||||||
r = snprintf(buf, buflen, "%s", tmp);
|
|
||||||
free(tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
r = snprintf(buf, buflen, "%s/%s", ic->sd->path, ic->info.file);
|
r = snprintf(buf, buflen, "%s/%s", ic->sd->path, ic->info.file);
|
||||||
|
|
||||||
return r < buflen;
|
return r < buflen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5780,9 +5763,9 @@ _e_fm2_inplace_open(const E_Fm2_Icon *ic)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
e_fm2_path_set(ic->sd->obj,
|
e_fm2_path_set(ic->sd->obj,
|
||||||
// ic->info.link ? "/" : ic->sd->dev,
|
ic->info.real_link ? "/" : ic->sd->dev,
|
||||||
ic->sd->dev,
|
|
||||||
buf);
|
buf);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue