* external.cc (cygwin_internal): Use security_descriptor::copy method.

* sec_helper.cc (security_descriptor::malloc): Use own free method.
	Set type.
	(security_descriptor::realloc): Handle the case that psd has been
	allocated using LocalAlloc.  Set type.
	(security_descriptor::free): Ditto.
	* security.cc (get_nt_attribute): Remove.
	(get_reg_security): Remove.
	(get_nt_object_security): Use GetSecurityInfo which handles all
	securable objects.
	(get_nt_object_attribute): Remove.
	(get_object_attribute): Call get_nt_object_security instead of
	get_nt_object_attribute.
	(get_file_attribute): Ditto.
	(check_registry_access): Call get_nt_object_security instead of
	get_reg_security.
	* security.h (cygpsid::operator PSID): Make method const, not the
	result.
	(class security_descriptor): Add type member.  Accomodate throughout.
	(security_descriptor::copy): New method.
	(security_descriptor::operator PSECURITY_DESCRIPTOR *): New operator.
This commit is contained in:
Corinna Vinschen
2006-10-22 14:57:43 +00:00
parent 2b26c2fc41
commit 2be593d961
5 changed files with 96 additions and 106 deletions

View File

@@ -293,11 +293,10 @@ cygwin_internal (cygwin_getinfo_types t, ...)
void *sd_buf = va_arg (arg, void *);
DWORD sd_buf_size = va_arg (arg, DWORD);
set_security_attribute (attribute, psa, sd);
if (!psa->lpSecurityDescriptor || sd.size () > sd_buf_size)
if (!psa->lpSecurityDescriptor)
return sd.size ();
memcpy (sd_buf, sd, sd.size ());
psa->lpSecurityDescriptor = sd_buf;
return 0;
return sd.copy (sd_buf, sd_buf_size);
}
case CW_GET_SHMLBA:
{