summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/sec_helper.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-03-18 17:15:27 +0100
committerCorinna Vinschen <corinna@vinschen.de>2015-03-18 17:15:27 +0100
commit4a9636b1d6d3380eaff53621498445f6adcfc18e (patch)
tree1fa05c56734c5f4e600e7e71362dcd0bac39b522 /winsup/cygwin/sec_helper.cc
parent1d91d469ee534fab47fdb710a037378c103fee23 (diff)
downloadcygnal-4a9636b1d6d3380eaff53621498445f6adcfc18e.tar.gz
cygnal-4a9636b1d6d3380eaff53621498445f6adcfc18e.tar.bz2
cygnal-4a9636b1d6d3380eaff53621498445f6adcfc18e.zip
Implmenet faster getfrompw/getfromgr
* grp.cc (pwdgrp::parse_group): Call cygsid::getfromgr_passwd. * passwd.cc (pwdgrp::parse_passwd): Call cygsid::getfrompw_gecos. * pwdgrp.h (cygsid::getfrompw): Implement as inline method here, accessing pg_pwd's sid member directly. (cygsid::getfromgr): Implement as inline method here, accessing pg_grp's sid member directly. * sec_auth.cc (extract_nt_dom_user): Call cygsid::getfrompw_gecos. Explain why. * sec_helper.cc (cygsid::getfrompw): Drop implementation. (cygsid::getfromgr): Ditto. * security.h (cygsid::getfrompw_gecos): Implement former getfrompw inline here. (cygsid::getfromgr_passwd): Implement former getfromgr inline here. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/sec_helper.cc')
-rw-r--r--winsup/cygwin/sec_helper.cc16
1 files changed, 1 insertions, 15 deletions
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index 946e78a8e..679f3a858 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -1,7 +1,7 @@
/* sec_helper.cc: NT security helper functions
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
- 2011, 2012, 2013, 2014 Red Hat, Inc.
+ 2011, 2012, 2013, 2014, 2015 Red Hat, Inc.
Written by Corinna Vinschen <corinna@vinschen.de>
@@ -279,20 +279,6 @@ cygsid::getfromstr (const char *nsidstr, bool well_known)
return psid = NO_SID;
}
-BOOL
-cygsid::getfrompw (const struct passwd *pw)
-{
- char *sp = (pw && pw->pw_gecos) ? strrchr (pw->pw_gecos, ',') : NULL;
- return (*this = sp ? sp + 1 : sp) != NULL;
-}
-
-BOOL
-cygsid::getfromgr (const struct group *gr)
-{
- char *sp = (gr && gr->gr_passwd) ? gr->gr_passwd : NULL;
- return (*this = sp) != NULL;
-}
-
cygsid *
cygsidlist::alloc_sids (int n)
{