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:
authorCorinna Vinschen <corinna@vinschen.de>2001-05-15 23:23:31 +0400
committerCorinna Vinschen <corinna@vinschen.de>2001-05-15 23:23:31 +0400
commit2b0a111fcf0a2e7276f9c0f1cb9e56dc5d14361c (patch)
tree16b8d3c8656971ba11a9fe6e86483314ea4ae3fa /winsup/cygwin/shared.cc
parent75f9ca7b0c317ba96a06f089cf44c0da46ee4996 (diff)
* 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/shared.cc')
-rw-r--r--winsup/cygwin/shared.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index 2312d81a4..28fbf4ceb 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -249,9 +249,9 @@ sec_user (PVOID sa_buf, PSID sid2, BOOL inherit)
size_t acl_len = sizeof (ACL)
+ 4 * (sizeof (ACCESS_ALLOWED_ACE) - sizeof (DWORD))
+ GetLengthSid (sid)
- + GetLengthSid (get_admin_sid ())
- + GetLengthSid (get_system_sid ())
- + GetLengthSid (get_creator_owner_sid ());
+ + GetLengthSid (well_known_admin_sid)
+ + GetLengthSid (well_known_system_sid)
+ + GetLengthSid (well_known_creator_owner_sid);
if (sid2)
acl_len += sizeof (ACCESS_ALLOWED_ACE) - sizeof (DWORD)
+ GetLengthSid (sid2);
@@ -266,17 +266,17 @@ sec_user (PVOID sa_buf, PSID sid2, BOOL inherit)
if (! AddAccessAllowedAce (acl, ACL_REVISION,
SPECIFIC_RIGHTS_ALL | STANDARD_RIGHTS_ALL,
- get_admin_sid ()))
+ well_known_admin_sid))
debug_printf ("AddAccessAllowedAce(admin) %E");
if (! AddAccessAllowedAce (acl, ACL_REVISION,
SPECIFIC_RIGHTS_ALL | STANDARD_RIGHTS_ALL,
- get_system_sid ()))
+ well_known_system_sid))
debug_printf ("AddAccessAllowedAce(system) %E");
if (! AddAccessAllowedAce (acl, ACL_REVISION,
SPECIFIC_RIGHTS_ALL | STANDARD_RIGHTS_ALL,
- get_creator_owner_sid ()))
+ well_known_creator_owner_sid))
debug_printf ("AddAccessAllowedAce(creator_owner) %E");
if (sid2)