Ignore non-absolute $HOME when started from native process

* uinfo.cc (cygheap_user::ontherange): Ignore $HOME if it's not
	starting with a slash (aka, absolute POSIX Path).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2015-07-23 17:42:07 +02:00
parent 7c96ab0b43
commit 1e80973f28
3 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2015-07-23 Corinna Vinschen <corinna@vinschen.de>
* uinfo.cc (cygheap_user::ontherange): Ignore $HOME if it's not
starting with a slash (aka, absolute POSIX Path).
2015-07-21 Corinna Vinschen <corinna@vinschen.de>
* common.din (siglongjmp): Export.

View File

@ -11,6 +11,9 @@ What's new:
What changed:
-------------
- When started from a non-Cygwin process, check if $HOME starts with a
slash (absolute POSIX path). Otherwise ignore it.
Bug Fixes
---------

View File

@ -331,8 +331,15 @@ cygheap_user::ontherange (homebodies what, struct passwd *pw)
char *p;
if ((p = getenv ("HOME")))
debug_printf ("HOME is already in the environment %s", p);
else
{
debug_printf ("HOME is already in the environment %s", p);
if (p[0] != '/')
{
p = NULL;
debug_printf ("discard HOME, no absolute POSIX path");
}
}
if (!p)
{
if (pw && pw->pw_dir && *pw->pw_dir)
{