From 565e80155b9e0f3f3fad8a85617d26c797514017 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 6 Feb 2003 14:01:54 +0000 Subject: * security.h: Introduce names UNKNOWN_UID and UNKNOWN_GID and delete declaration of is_grp_member. * uinfo.cc (internal_getlogin): Use UNKNOWN_GID. * passwd.cc (pwdgrp::read_passwd): Use UNKNOWN_UID. * grp.cc (pwdgrp::read_group): Change group name to provide better feedback. (getgrgid): Use gid16togid32. * sec_helper.cc (is_grp_member): Delete. --- winsup/cygwin/sec_helper.cc | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'winsup/cygwin/sec_helper.cc') diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index e4f7419..749596e 100644 --- a/winsup/cygwin/sec_helper.cc +++ b/winsup/cygwin/sec_helper.cc @@ -223,47 +223,6 @@ get_sids_info (cygpsid owner_sid, cygpsid group_sid, __uid32_t * uidret, __gid32 return ret; } -BOOL -is_grp_member (__uid32_t uid, __gid32_t gid) -{ - struct passwd *pw; - struct __group32 *gr; - int idx; - - /* Evaluate current user info by examining the info given in cygheap and - the current access token if ntsec is on. */ - if (uid == myself->uid) - { - /* If gid == primary group of current user, return immediately. */ - if (gid == myself->gid) - return TRUE; - /* Calling getgroups only makes sense when reading the access token. */ - if (allow_ntsec) - { - __gid32_t grps[NGROUPS_MAX]; - int cnt = internal_getgroups (NGROUPS_MAX, grps); - for (idx = 0; idx < cnt; ++idx) - if (grps[idx] == gid) - return TRUE; - return FALSE; - } - } - - /* Otherwise try getting info from examining passwd and group files. */ - if ((pw = internal_getpwuid (uid))) - { - /* If gid == primary group of uid, return immediately. */ - if ((__gid32_t) pw->pw_gid == gid) - return TRUE; - /* Otherwise search for supplementary user list of this group. */ - if ((gr = internal_getgrgid (gid))) - for (idx = 0; gr->gr_mem[idx]; ++idx) - if (strcasematch (cygheap->user.name (), gr->gr_mem[idx])) - return TRUE; - } - return FALSE; -} - #if 0 // unused #define SIDLEN (sidlen = MAX_SID_LEN, &sidlen) #define DOMLEN (domlen = INTERNET_MAX_HOST_NAME_LENGTH, &domlen) -- cgit v1.1