* cygheap.h (cygheap_user::userprofile_env_buf): New static member.

* environ.cc (build_env): Add debugging statement.
(spenvs): Switch functions for USERDOMAIN and USERNAME.
* spawn.cc (spawn_guts): Move environment initialization prior to
cygheap_setup_for_child or environment info will never be copied to child.
This commit is contained in:
Christopher Faylor
2002-06-14 21:46:19 +00:00
parent b56d7e7937
commit 6d171b4482
5 changed files with 20 additions and 7 deletions

View File

@ -190,6 +190,7 @@ cuserid (char *src)
char cygheap_user::homepath_env_buf[MAX_PATH + 1];
char cygheap_user::homedrive_env_buf[3];
char cygheap_user::userprofile_env_buf[MAX_PATH + 1];
const char *
cygheap_user::ontherange (homebodies what, struct passwd *pw)
@ -335,12 +336,11 @@ cygheap_user::env_domain ()
const char *
cygheap_user::env_userprofile ()
{
static char buf[512]; /* FIXME: This shouldn't be static. */
if (strcasematch (name (), "SYSTEM") || !env_domain () || !env_logsrv ())
return NULL;
if (get_registry_hive_path (sid (), buf))
return buf;
if (get_registry_hive_path (sid (), userprofile_env_buf))
return userprofile_env_buf;
else
return NULL;
}