diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-05-15 19:23:31 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-05-15 19:23:31 +0000 |
commit | 2b0a111fcf0a2e7276f9c0f1cb9e56dc5d14361c (patch) | |
tree | 16b8d3c8656971ba11a9fe6e86483314ea4ae3fa /winsup/cygwin/registry.cc | |
parent | 75f9ca7b0c317ba96a06f089cf44c0da46ee4996 (diff) | |
download | newlib-2b0a111fcf0a2e7276f9c0f1cb9e56dc5d14361c.zip newlib-2b0a111fcf0a2e7276f9c0f1cb9e56dc5d14361c.tar.gz newlib-2b0a111fcf0a2e7276f9c0f1cb9e56dc5d14361c.tar.bz2 |
* fork.cc (fork): Eliminate superfluous call to getuid().
* security.h: New define `NO_SID'. Remove declarations of functions
moved to methods into class cygsid.
(class cygsid): Declare new methods `getfromstr', `get_sid',
`getfrompw', `getfromgr', `get_rid', `get_uid', `get_gid', `string'
and new constructors and operators =, == and !=.
Declare new global cygsids `well_known_XXX_sid' substituting the
corresponding `get_XXX_sid' functions. Remove declarations of
these functions.
* sec_helper.cc (well_known_admin_sid): New global variable.
(well_known_system_sid): Ditto
(well_known_creator_owner_sid): Ditto
(well_known_world_sid): Ditto
(cygsid::string): New method, substituting `convert_sid_to_string_sid'.
(cygsid::get_sid): New method, substituting `get_sid'.
(cygsid::getfromstr): New method, substituting
`convert_string_sid_to_sid'.
(cygsid::getfrompw): New method, substituting `get_pw_sid'.
(cygsid::getfromgr): New method, substituting `get_gr_sid'.
(cygsid::get_id): New method, substituting `get_id_from_sid'.
(get_admin_sid): Eliminated.
(get_system_sid): Ditto.
(get_creator_owner_sid): Ditto.
(get_world_sid): Ditto.
* grp.cc: Use new cygsid methods and well known sids throughout.
* registry.cc: Ditto.
* sec_acl.cc: Ditto.
* security.cc: Ditto.
* shared.cc: Ditto.
* syscalls.cc (seteuid): Ditto. Eliminate redundant conditional.
* uinfo.cc (internal_getlogin): Ditto.
* spawn.cc (spawn_guts) Revert previous patch.
Diffstat (limited to 'winsup/cygwin/registry.cc')
-rw-r--r-- | winsup/cygwin/registry.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/winsup/cygwin/registry.cc b/winsup/cygwin/registry.cc index f269125..1d3cce5 100644 --- a/winsup/cygwin/registry.cc +++ b/winsup/cygwin/registry.cc @@ -202,7 +202,8 @@ get_registry_hive_path (const PSID psid, char *path) if (!psid || !path) return NULL; - convert_sid_to_string_sid (psid, sid); + cygsid csid (psid); + csid.string (sid); strcpy (key,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\"); strcat (key, sid); if (!RegOpenKeyExA (HKEY_LOCAL_MACHINE, key, 0, KEY_READ, &hkey)) @@ -232,8 +233,9 @@ load_registry_hive (PSID psid) if (!psid) return; /* Check if user hive is already loaded. */ - if (!RegOpenKeyExA (HKEY_USERS, convert_sid_to_string_sid (psid, sid), - 0, KEY_READ, &hkey)) + cygsid csid (psid); + csid.string (sid); + if (!RegOpenKeyExA (HKEY_USERS, csid.string (sid), 0, KEY_READ, &hkey)) { debug_printf ("User registry hive for %s already exists", sid); RegCloseKey (hkey); |