* uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.

(cygheap_user::env_logsrv): Verify env_domain is valid.
* environ.cc: Include child_info.h and keep spenvs[] sorted.
(environ_init): Check child_proc_info instead of myself->ppid_handle.
This commit is contained in:
Christopher Faylor
2002-06-21 05:01:17 +00:00
parent a7b23a8f11
commit 7c02f861e3
7 changed files with 23 additions and 15 deletions

View File

@@ -25,6 +25,7 @@ details. */
#include "cygheap.h"
#include "registry.h"
#include "environ.h"
#include "child_info.h"
extern BOOL allow_daemon;
extern BOOL allow_glob;
@@ -712,7 +713,7 @@ environ_init (char **envp, int envc)
char *eq;
if ((eq = strchr (newp, '=')) == NULL)
eq = strchr (newp, '\0');
if (!myself->ppid_handle)
if (!child_proc_info)
ucenv (newp, eq);
if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0)
sawTERM = 1;
@@ -765,8 +766,8 @@ char env_dontadd[] = "";
/* Keep this list in upper case and sorted */
static NO_COPY spenv spenvs[] =
{
{NL ("HOMEPATH="), &cygheap_user::env_homepath},
{NL ("HOMEDRIVE="), &cygheap_user::env_homedrive},
{NL ("HOMEPATH="), &cygheap_user::env_homepath},
{NL ("LOGONSERVER="), &cygheap_user::env_logsrv},
{NL ("SYSTEMDRIVE="), NULL},
{NL ("SYSTEMROOT="), NULL},
@@ -809,7 +810,7 @@ spenv::retrieve (bool no_envblock, const char *const envname)
/* Calculate (potentially) value for given environment variable. */
p = (cygheap->user.*from_cygheap) ();
if (!p || (no_envblock && !envname))
return env_dontadd;
return env_dontadd;
char *s = (char *) cmalloc (HEAP_1_STR, namelen + strlen (p) + 1);
strcpy (s, name);
(void) strcpy (s + namelen, p);