summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-07-23 17:42:07 +0200
committerCorinna Vinschen <corinna@vinschen.de>2015-07-23 17:42:07 +0200
commit1e80973f288a6285f73b4565e7c4fcee12713b72 (patch)
tree03fa47ed163a396fb9a914b96e4ee1841e43c5f4 /winsup/cygwin
parent7c96ab0b434ea7d1f998841f39a5a704b84a87d2 (diff)
downloadcygnal-1e80973f288a6285f73b4565e7c4fcee12713b72.tar.gz
cygnal-1e80973f288a6285f73b4565e7c4fcee12713b72.tar.bz2
cygnal-1e80973f288a6285f73b4565e7c4fcee12713b72.zip
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>
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/release/2.2.03
-rw-r--r--winsup/cygwin/uinfo.cc11
3 files changed, 17 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 2d8475b14..55ea458f0 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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.
diff --git a/winsup/cygwin/release/2.2.0 b/winsup/cygwin/release/2.2.0
index 2fab1f64a..39df25c3d 100644
--- a/winsup/cygwin/release/2.2.0
+++ b/winsup/cygwin/release/2.2.0
@@ -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
---------
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index bc5f814d0..334c2e988 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -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)
{