]> sourceware.org Git - newlib-cygwin.git/commitdiff
Ignore non-absolute $HOME when started from native process
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 23 Jul 2015 15:42:07 +0000 (17:42 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 23 Jul 2015 15:42:07 +0000 (17:42 +0200)
* 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>
winsup/cygwin/ChangeLog
winsup/cygwin/release/2.2.0
winsup/cygwin/uinfo.cc

index 2d8475b14639ebf2e18a8af070294cb15998667d..55ea458f0be5c3155e68eef10a0742b8c1bbddbc 100644 (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.
index 2fab1f64a6af10b6319a961f60112e6a29d67607..39df25c3d2aba2a50878663e2a529b18beb1715c 100644 (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
 ---------
index bc5f814d03c6d354e3bdfce2a21b080105e068c9..334c2e9885cfa7ecf7a0a802440708ea073e2198 100644 (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)
            {
This page took 0.037448 seconds and 5 git commands to generate.