diff options
author | Christopher Faylor <me@cgf.cx> | 2002-06-30 02:05:30 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-06-30 02:05:30 +0400 |
commit | efc1575ecd6c005883f5e4bb292a6a33a4c17b2a (patch) | |
tree | 41df41dd3c8695122f44a4d06bf66fd50a2867ed /winsup/cygwin/uinfo.cc | |
parent | 638180f51f6db54d42f48b4e5daabd159d71484a (diff) |
* autoload.cc (NetGetDCName): Change to make this an optional load function.
* cygheap.h (cygheap_user::logsrv): Return NULL when operation fails.
(cygheap_user::winname): Ditto.
(cygheap_user::domain): Ditto.
* uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable.
(cygheap_user::env_userprofile): Ditto.
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r-- | winsup/cygwin/uinfo.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index ae500049e..2b506bde9 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -319,12 +319,14 @@ cygheap_user::env_logsrv (const char *name, size_t namelen) if (test_uid (plogsrv, name, namelen)) return plogsrv; - if (!domain () || strcasematch (winname (), "SYSTEM")) + const char *mydomain = domain (); + const char *myname = winname (); + if (!mydomain || strcasematch (myname, "SYSTEM")) return almost_null; char logsrv[INTERNET_MAX_HOST_NAME_LENGTH + 3]; cfree_and_set (plogsrv, almost_null); - if (get_logon_server (domain (), logsrv, NULL)) + if (get_logon_server (mydomain, logsrv, NULL)) plogsrv = cstrdup (logsrv); return plogsrv; } @@ -363,7 +365,8 @@ cygheap_user::env_userprofile (const char *name, size_t namelen) char userprofile_env_buf[MAX_PATH + 1]; cfree_and_set (puserprof, almost_null); /* FIXME: Should this just be setting a puserprofile like everything else? */ - if (!strcasematch (winname (), "SYSTEM") + const char *myname = winname (); + if (myname && strcasematch (myname, "SYSTEM") && get_registry_hive_path (sid (), userprofile_env_buf)) puserprof = cstrdup (userprofile_env_buf); |