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:
parent
7c96ab0b43
commit
1e80973f28
|
@ -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>
|
2015-07-21 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* common.din (siglongjmp): Export.
|
* common.din (siglongjmp): Export.
|
||||||
|
|
|
@ -11,6 +11,9 @@ What's new:
|
||||||
What changed:
|
What changed:
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
- When started from a non-Cygwin process, check if $HOME starts with a
|
||||||
|
slash (absolute POSIX path). Otherwise ignore it.
|
||||||
|
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------
|
---------
|
||||||
|
|
|
@ -331,8 +331,15 @@ cygheap_user::ontherange (homebodies what, struct passwd *pw)
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if ((p = getenv ("HOME")))
|
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)
|
if (pw && pw->pw_dir && *pw->pw_dir)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue