Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-06-12 09:13:54 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-12 09:13:54 +0400
commitda086d020cc3fd5c0a374ca753dfb0bc62a3cda0 (patch)
tree66bfacfed261a4c61efbf482a93606fac66b96f2 /winsup/cygwin/cygheap.h
parent09c95bb14fd314b0529e1183c26d72dba386832a (diff)
* cygheap.cc (cygheap_user::set_name): Set homedrive and homepath to NULL on
user name change. (cygheap_user::set_logsrv): Allocate enough space for leading \\ so that we can put this in the environment, if needed. * cygheap.h (homebodies): New enum. (cygheap_user::homedrive): New field. (cygheap_user::homepath): Ditto. (cygheap_user::env_logsrv): New method. (cygheap_user::env_homepath): New method. (cygheap_user::env_homedrive): New method. (cygheap_user::env_userprofile): New method. (cygheap_user::ontherange): New method. * environ.cc (envsize): Eliminate debugging argument. (environ_init): Assume that envc counts number of elments not total size. (spenv): New class. (spenvs): New array, renamed from forced_winenv_vars, using spenv. (spenv::retrieve): New method. (build_env): Rename from 'winenv' -- one stop shopping for building new environment blocks for both windows and "unix". * environ.h (build_env: Declare. (winenv): Delete declaration. (envsize): Ditto. * spawn.cc (spawn_guts): Use build_env to build windows and cygwin environment blocks. * uinfo.cc (internal_getlogin): Eliminate environment manipulation. Default to info from GetUserName if it exists. Move HOMEPATH and HOMEDRIVE stuff elsewhere. Move HOME setting elsewhere. Only set HOME environment variable in processes that are not parented by a cygwin process. (cygheap_user::ontherange): Define new method. (cygheap_user::env_logsrv): Ditto. (cygheap_user::env_homepath): Ditto. (cygheap_user::env_homedrive): Ditto. (cygheap_user::env_userprofile): Ditto.
Diffstat (limited to 'winsup/cygwin/cygheap.h')
-rw-r--r--winsup/cygwin/cygheap.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h
index f4ef14459..e4fbe5fcb 100644
--- a/winsup/cygwin/cygheap.h
+++ b/winsup/cygwin/cygheap.h
@@ -85,6 +85,14 @@ public:
const char *native_path () const { return m->native_path; }
};
+enum homebodies
+{
+ CH_HOMEDRIVE,
+ CH_HOMEPATH,
+ CH_HOME
+};
+
+struct passwd;
class cygheap_user
{
/* Extendend user information.
@@ -93,6 +101,8 @@ class cygheap_user
char *pname; /* user's name */
char *plogsrv; /* Logon server, may be FQDN */
char *pdomain; /* Logon domain of the user */
+ char *homedrive; /* User's home drive */
+ char *homepath; /* User's home path */
PSID psid; /* buffer for user's SID */
PSID orig_psid; /* Remains intact even after impersonation */
public:
@@ -116,6 +126,11 @@ public:
void set_logsrv (const char *new_logsrv);
const char *logsrv () const { return plogsrv; }
+ const char *env_logsrv ();
+ const char *env_homepath ();
+ const char *env_homedrive ();
+ const char *env_userprofile ();
+
void set_domain (const char *new_domain);
const char *domain () const { return pdomain; }
@@ -130,6 +145,7 @@ public:
set_domain (user.domain ());
set_sid (user.sid ());
}
+ const char *ontherange (homebodies what, struct passwd * = NULL);
};
/* cwd cache stuff. */