diff options
author | Christopher Faylor <me@cgf.cx> | 2002-06-29 02:36:08 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-06-29 02:36:08 +0000 |
commit | 094d51931173d399d5719411554e1c61af500bfe (patch) | |
tree | 9194597b3e482e0d6990cf543ff7e3cd4f8f0c4f /winsup/cygwin/cygheap.h | |
parent | 2d5eb17ee38b19b91eaecceb9136885aa4281080 (diff) | |
download | newlib-094d51931173d399d5719411554e1c61af500bfe.zip newlib-094d51931173d399d5719411554e1c61af500bfe.tar.gz newlib-094d51931173d399d5719411554e1c61af500bfe.tar.bz2 |
* cygheap.h (cygheap_user): Reorg to accommodate environment caching.
(cygheap_user::logsrv): New method.
(cygheap_user::winname): Ditto.
(cygheap_user::domain): Ditto.
(cygheap_user::test_uid): Ditto.
* cygheap.cc (cygheap_user::set_name): Reflect name "pwinname" name change.
* environ.cc (getwinenveq): New function.
(spenv::from_cygheap): Change arguments.
(spenv::retrieve): Ditto for call. Use getwinenveq to retrieve info from
environment. Always return value from cygwin environment, if it exists.
* environ.h (getwinenveq): Declare.
* uinfo.cc (cygheap_user::ontherange): Use logsrv() rather than env_logsrv().
(cygheap_user::test_uid): Define new method.
(cygheap_user::env_logsrv): Accept environment arguments. Use test_uid to find
info.
(cygheap_user::env_domain): Ditto.
(cygheap_user::env_userprofile): Ditto.
(cygheap_user::env_homepath): Ditto.
(cygheap_user::env_homedrive): Ditto.
(cygheap_user::env_name): Ditto.
Diffstat (limited to 'winsup/cygwin/cygheap.h')
-rw-r--r-- | winsup/cygwin/cygheap.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index e2fcaec..63585d9 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -93,6 +93,7 @@ enum homebodies }; struct passwd; + class cygheap_user { /* Extendend user information. @@ -103,7 +104,7 @@ class cygheap_user char *pdomain; /* Logon domain of the user */ char *homedrive; /* User's home drive */ char *homepath; /* User's home path */ - char *winname; /* User's name as far as Windows knows it */ + char *pwinname; /* User's name as far as Windows knows it */ char *puserprof; /* User profile */ PSID psid; /* buffer for user's SID */ PSID orig_psid; /* Remains intact even after impersonation */ @@ -134,13 +135,25 @@ public: void set_name (const char *new_name); const char *name () const { return pname; } - const char *env_logsrv (); - const char *env_homepath (); - const char *env_homedrive (); - const char *env_userprofile (); - const char *env_domain (); - const char *env_name (); + const char *env_logsrv (const char *, size_t); + const char *env_homepath (const char *, size_t); + const char *env_homedrive (const char *, size_t); + const char *env_userprofile (const char *, size_t); + const char *env_domain (const char *, size_t); + const char *env_name (const char *, size_t); + const char *logsrv () + { + return env_logsrv ("LOGONSERVER=", sizeof ("LOGONSERVER=") - 1); + } + const char *winname () + { + return env_name ("USERNAME=", sizeof ("USERNAME=") - 1); + } + const char *domain () + { + return env_domain ("USERDOMAIN=", sizeof ("USERDOMAIN=") - 1); + } BOOL set_sid (PSID new_sid); BOOL set_orig_sid (); PSID sid () const { return psid; } @@ -150,6 +163,8 @@ public: { return impersonated && token != INVALID_HANDLE_VALUE; } + const char *cygheap_user::test_uid (char *&, const char *, size_t) + __attribute__ ((regparm (3))); }; /* cwd cache stuff. */ |