]> sourceware.org Git - newlib-cygwin.git/commitdiff
* cygheap.cc (cygheap_init): Set umask to a sane default.
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 6 May 2009 11:52:20 +0000 (11:52 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 6 May 2009 11:52:20 +0000 (11:52 +0000)
* uinfo.cc (cygheap_user::ontherange): Don't use HOMEDRIVE/HOMEPATH
to set HOME.  Default to /home/USERNAME.

winsup/cygwin/ChangeLog
winsup/cygwin/cygheap.cc
winsup/cygwin/uinfo.cc

index 4ca22d84bd886b3847881e5181e7a876da4d37c4..3374f58d251f234e2f66545be78eac3d7eeb99b8 100644 (file)
@@ -1,3 +1,9 @@
+2009-05-06  Corinna Vinschen  <corinna@vinschen.de>
+
+       * cygheap.cc (cygheap_init): Set umask to a sane default.
+       * uinfo.cc (cygheap_user::ontherange): Don't use HOMEDRIVE/HOMEPATH
+       to set HOME.  Default to /home/USERNAME.
+
 2009-05-03  Corinna Vinschen  <corinna@vinschen.de>
 
        * security.cc (set_file_sd): Drop using FILE_OPEN_FOR_RECOVERY flag in
index bddc6ce666e638111277b03beb6a5215c85820f3..1e579f341c3a7fbe22be580b419bd0f01670ea2d 100644 (file)
@@ -156,6 +156,8 @@ cygheap_init ()
                                         _cygheap_mid - _cygheap_start);
       cygheap_max = cygheap;
       _csbrk (sizeof (*cygheap));
+      /* Set umask to a sane default. */
+      cygheap->umask = 022;
     }
   if (!cygheap->fdtab)
     cygheap->fdtab.init ();
index 8ca382bfedcbd1b379ab782bd9386cbf2c7d2a55..8adfd37b8ddc83b36b99251087a7eb45a094c8c7 100644 (file)
@@ -248,15 +248,6 @@ cygheap_user::ontherange (homebodies what, struct passwd *pw)
   if (what == CH_HOME)
     {
       char *p;
-      if (homedrive)
-       newhomedrive = homedrive;
-      else if ((p = getenv ("HOMEDRIVE")))
-       newhomedrive = p;
-
-      if (homepath)
-       newhomepath = homepath;
-      else if ((p = getenv ("HOMEPATH")))
-       newhomepath = p;
 
       if ((p = getenv ("HOME")))
        debug_printf ("HOME is already in the environment %s", p);
@@ -267,17 +258,12 @@ cygheap_user::ontherange (homebodies what, struct passwd *pw)
              debug_printf ("Set HOME (from /etc/passwd) to %s", pw->pw_dir);
              setenv ("HOME", pw->pw_dir, 1);
            }
-         else if (!newhomedrive || !newhomepath)
-           setenv ("HOME", "/", 1);
          else
            {
-             char *home = tp.c_get ();
-             char *buf = tp.c_get ();
-             strcpy (buf, newhomedrive);
-             strcat (buf, newhomepath);
-             cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, buf, home,
-                               NT_MAX_PATH);
-             debug_printf ("Set HOME (from HOMEDRIVE/HOMEPATH) to %s", home);
+             char home[strlen (name ()) + 8];
+
+             debug_printf ("Set HOME to default /home/USER");
+             __small_sprintf (home, "/home/%s", name ());
              setenv ("HOME", home, 1);
            }
        }
This page took 0.03806 seconds and 5 git commands to generate.