This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: security.cc


Hi Pierre,

On Tue, Feb 04, 2003 at 10:38:16AM -0500, Pierre A. Humblet wrote:
> This patch defines a new function get_sids_info that greatly reduces
> the number of passwd/group lookups, compared to the current approach.

this new get_sids_info() function does reimplement the functionality
of is_grp_member() in just a slightly different way.  I think that's
pretty unlucky since now we have two functions doing nearly the same.
Wouldn't it make sense to replace the remaining is_grp_member() calls
in sec_acl.cc by calls to get_sids_info(), too?

> 2003/02/04  Pierre Humblet  <pierre.humblet@ieee.org>

Could you please use the common format for the date in the ChangeLog,
using dashes instead of slashes?  Thanks.

> 	* sec_helper.cc (get_sids_info): New function.
> 	* security.cc (extract_nt_dom_user): Simplify with strechr.
> 	(get_user_groups): Initialize glen to MAX_SID_LEN.
> 	(get_user_local_groups): Ditto.
> 	(get_attribute_from_acl): Define ace_sid as cygpsid.
> 	(get_nt_attribute): Define owner_sid and group_sid as cygpsid.
> 	Call get_sids_info instead of cygsid.get_{u,g}id and is_grp_member.
> 	(get_nt_object_attribute): Ditto.
> 	(alloc_sd): Define ace_sid as cygpsid.

Otherwise applied with a minor change:

> +  if (!GetSecurityDescriptorOwner (psd, (void **) &owner_sid, &dummy))
  +  if (!GetSecurityDescriptorOwner (psd, (PSID *) &owner_sid, &dummy))

> +  if (!GetSecurityDescriptorGroup (psd, (void **) &group_sid, &dummy))
  +  if (!GetSecurityDescriptorGroup (psd, (PSID *) &group_sid, &dummy))

> +					(void **) &owner_sid, (void **) &group_sid,
  +					(PSID *) &owner_sid,
  +					(PSID *) &group_sid,


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]