diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-02-06 17:01:54 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-02-06 17:01:54 +0300 |
commit | 565e80155b9e0f3f3fad8a85617d26c797514017 (patch) | |
tree | 8613a6bbba76b550c1c71ba79fc165a92e16a0ac /winsup/cygwin/sec_helper.cc | |
parent | f865f0c4799f3e92ce43743bd204437c0d7da45c (diff) |
* 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.
Diffstat (limited to 'winsup/cygwin/sec_helper.cc')
-rw-r--r-- | winsup/cygwin/sec_helper.cc | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc index e4f7419a7..749596e63 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) |