elm config - handle profile name of ".." as its obviously invalid

this forbids .., as a profile name in addition to the existing "stip /
from profile name".
This commit is contained in:
Carsten Haitzler 2017-02-08 17:50:47 +09:00
parent 8094893877
commit 944ce7ef41
2 changed files with 8 additions and 5 deletions

View File

@ -107,8 +107,6 @@ eina_environment_tmp_get(void)
if (!tmp) tmp = getenv("USERPROFILE");
if (!tmp) tmp = getenv("WINDIR");
if (!tmp) tmp = "C:\\";
return tmp;
#else
# if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
if (getuid() == geteuid())
@ -120,7 +118,7 @@ eina_environment_tmp_get(void)
if (!tmp) tmp = getenv("TEMP");
}
if (!tmp) tmp = "/tmp";
return tmp;
#endif
tmp = strdup(tmp);
return tmp;
}

View File

@ -1456,8 +1456,13 @@ _profile_fetch_from_conf(void)
{
p = strchr(_elm_profile, '/');
if (p) *p = 0;
if (!strcmp(_elm_profile, ".."))
{
free(_elm_profile);
_elm_profile = NULL;
}
else return;
}
return;
}
for (i = 0; i < 2; i++)