diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-05-08 14:21:08 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-05-08 14:21:08 +0000 |
commit | 6327de5fef1da1866695426cb7d73d47e157b971 (patch) | |
tree | f87fd62d20a18f98567dbea0510a2491716cc11d /winsup/cygwin | |
parent | 84d06cb64d051a07fb3a41fcbc5f3239cb6cc532 (diff) | |
download | newlib-6327de5fef1da1866695426cb7d73d47e157b971.zip newlib-6327de5fef1da1866695426cb7d73d47e157b971.tar.gz newlib-6327de5fef1da1866695426cb7d73d47e157b971.tar.bz2 |
* cygheap.h (class cygheap_user): Add member `orig_psid'.
Add method `orig_sid()'.
* cygheap.cc (cygheap_user::set_sid): Maintain orig_psid.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/cygheap.cc | 12 | ||||
-rw-r--r-- | winsup/cygwin/cygheap.h | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 42e1833..e33b5bd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2002-05-08 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (class cygheap_user): Add member `orig_psid'. + Add method `orig_sid()'. + * cygheap.cc (cygheap_user::set_sid): Maintain orig_psid. + 2002-04-28 Norbert Schulze <norbert.schulze@web.de> * localtime.cc (tzsetwall): Use wildabbr if generated timezone name diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc index 5d77074..0992ad3 100644 --- a/winsup/cygwin/cygheap.cc +++ b/winsup/cygwin/cygheap.cc @@ -468,13 +468,23 @@ cygheap_user::set_sid (PSID new_sid) { if (psid) cfree (psid); + if (orig_psid) + cfree (orig_psid); psid = NULL; + orig_psid = NULL; return TRUE; } else { if (!psid) - psid = cmalloc (HEAP_STR, MAX_SID_LEN); + { + if (!orig_psid) + { + orig_psid = cmalloc (HEAP_STR, MAX_SID_LEN); + CopySid (MAX_SID_LEN, orig_psid, new_sid); + } + psid = cmalloc (HEAP_STR, MAX_SID_LEN); + } return CopySid (MAX_SID_LEN, psid, new_sid); } } diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index 154fd24..f7c507e 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -94,6 +94,7 @@ class cygheap_user char *plogsrv; /* Logon server, may be FQDN */ char *pdomain; /* Logon domain of the user */ PSID psid; /* buffer for user's SID */ + PSID orig_psid; /* Remains intact even after impersonation */ public: __uid16_t orig_uid; /* Remains intact even after impersonation */ __uid16_t orig_gid; /* Ditto */ @@ -120,6 +121,7 @@ public: BOOL set_sid (PSID new_sid); PSID sid () const { return psid; } + PSID orig_sid () const { return orig_psid; } void operator =(cygheap_user &user) { |