(SetSecurityDescriptorGroup): Remove.
(SetSecurityDescriptorOwner): Remove.
* pinfo.cc: Replace above functions throughout with their ntdll.dll
equivalent.
* sec_acl.cc: Ditto.
* sec_helper.cc: Ditto.
* security.cc: Ditto.
* sec_helper.cc (__sec_user): Remove old comment.
2011-04-28 Corinna Vinschen <corinna@vinschen.de>
+ * advapi32.cc (SetSecurityDescriptorDacl): Remove.
+ (SetSecurityDescriptorGroup): Remove.
+ (SetSecurityDescriptorOwner): Remove.
+ * pinfo.cc: Replace above functions throughout with their ntdll.dll
+ equivalent.
+ * sec_acl.cc: Ditto.
+ * sec_helper.cc: Ditto.
+ * security.cc: Ditto.
+
+ * sec_helper.cc (__sec_user): Remove old comment.
+
+2011-04-28 Corinna Vinschen <corinna@vinschen.de>
+
* posix_ipc.cc (ipc_cond_timedwait): Also wait for pthread's
cancel_event, if any. Call pthread_testcancel if cancel_event has been
signalled.
}
BOOL WINAPI
-SetSecurityDescriptorDacl (PSECURITY_DESCRIPTOR sd, BOOL present, PACL dacl,
- BOOL def)
-{
- NTSTATUS status = RtlSetDaclSecurityDescriptor (sd, (BOOLEAN) !!present, dacl,
- (BOOLEAN) !!def);
- DEFAULT_NTSTATUS_TO_BOOL_RETURN
-}
-
-BOOL WINAPI
-SetSecurityDescriptorGroup (PSECURITY_DESCRIPTOR sd, PSID sid, BOOL def)
-{
- NTSTATUS status = RtlSetGroupSecurityDescriptor (sd, sid, (BOOLEAN) !!def);
- DEFAULT_NTSTATUS_TO_BOOL_RETURN
-}
-
-BOOL WINAPI
-SetSecurityDescriptorOwner (PSECURITY_DESCRIPTOR sd, PSID sid, BOOL def)
-{
- NTSTATUS status = RtlSetOwnerSecurityDescriptor (sd, sid, (BOOLEAN) !!def);
- DEFAULT_NTSTATUS_TO_BOOL_RETURN
-}
-
-BOOL WINAPI
OpenThreadToken (HANDLE thread, DWORD access, BOOL as_self, PHANDLE tok)
{
NTSTATUS status = NtOpenThreadToken (thread, access, as_self, tok);
sec_acl (acl_buf, true, true, cygheap->user.sid (),
well_known_world_sid, FILE_MAP_READ);
RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);
- if (!SetSecurityDescriptorDacl (&sd, TRUE, acl_buf, FALSE))
- debug_printf ("SetSecurityDescriptorDacl %E");
+ status = RtlSetDaclSecurityDescriptor (&sd, TRUE, acl_buf, FALSE);
+ if (!NT_SUCCESS (status))
+ debug_printf ("RtlSetDaclSecurityDescriptor %p", status);
else if ((status = NtSetSecurityObject (h, DACL_SECURITY_INFORMATION, &sd)))
- debug_printf ("NtSetSecurityObject %lx", status);
+ debug_printf ("NtSetSecurityObject %p", status);
}
const char *
/* Initialize local security descriptor. */
SECURITY_DESCRIPTOR sd;
RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);
- if (!SetSecurityDescriptorOwner (&sd, owner, FALSE))
+ status = RtlSetOwnerSecurityDescriptor (&sd, owner, FALSE);
+ if (!NT_SUCCESS (status))
{
- __seterrno ();
+ __seterrno_from_nt_status (status);
return -1;
}
- if (!SetSecurityDescriptorGroup (&sd, group, FALSE))
+ status = RtlSetGroupSecurityDescriptor (&sd, group, FALSE);
+ if (!NT_SUCCESS (status))
{
- __seterrno ();
+ __seterrno_from_nt_status (status);
return -1;
}
acl->AclSize = acl_len;
debug_printf ("ACL-Size: %d", acl_len);
/* Create DACL for local security descriptor. */
- if (!SetSecurityDescriptorDacl (&sd, TRUE, acl, FALSE))
+ status = RtlSetDaclSecurityDescriptor (&sd, TRUE, acl, FALSE);
+ if (!NT_SUCCESS (status))
{
- __seterrno ();
+ __seterrno_from_nt_status (status);
return -1;
}
/* Make self relative security descriptor in sd_ret. */
if (!null_sdp)
{
RtlCreateSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);
- SetSecurityDescriptorDacl (&sd, TRUE, NULL, FALSE);
+ RtlSetDaclSecurityDescriptor (&sd, TRUE, NULL, FALSE);
null_sdp = &sd;
}
return null_sdp;
PSECURITY_DESCRIPTOR psd = (PSECURITY_DESCRIPTOR)
((char *) sa_buf + sizeof (*psa));
PACL acl = (PACL) ((char *) sa_buf + sizeof (*psa) + sizeof (*psd));
+ NTSTATUS status;
#ifdef DEBUGGING
if ((unsigned long) sa_buf % 4)
return inherit ? &sec_none : &sec_none_nih;
RtlCreateSecurityDescriptor (psd, SECURITY_DESCRIPTOR_REVISION);
-
-/*
- * Setting the owner lets the created security attribute not work
- * on NT4 SP3 Server. Don't know why, but the function still does
- * what it should do also if the owner isn't set.
-*/
-#if 0
- if (!SetSecurityDescriptorOwner (psd, sid, FALSE))
- debug_printf ("SetSecurityDescriptorOwner %E");
-#endif
-
- if (!SetSecurityDescriptorDacl (psd, TRUE, acl, FALSE))
- debug_printf ("SetSecurityDescriptorDacl %E");
+ status = RtlSetDaclSecurityDescriptor (psd, TRUE, acl, FALSE);
+ if (!NT_SUCCESS (status))
+ debug_printf ("RtlSetDaclSecurityDescriptor %p", status);
psa->nLength = sizeof (SECURITY_ATTRIBUTES);
psa->lpSecurityDescriptor = psd;
return NULL;
}
dacl->AclSize = (char *) ace - (char *) dacl;
- SetSecurityDescriptorDacl (psd, TRUE, dacl, FALSE);
+ RtlSetDaclSecurityDescriptor (psd, TRUE, dacl, FALSE);
}
return psd;
}
RtlSetControlSecurityDescriptor (&sd, SE_DACL_PROTECTED, SE_DACL_PROTECTED);
/* Create owner for local security descriptor. */
- if (!SetSecurityDescriptorOwner (&sd, owner_sid, FALSE))
+ status = RtlSetOwnerSecurityDescriptor (&sd, owner_sid, FALSE);
+ if (!NT_SUCCESS (status))
{
- __seterrno ();
+ __seterrno_from_nt_status (status);
return NULL;
}
/* Create group for local security descriptor. */
- if (!SetSecurityDescriptorGroup (&sd, group_sid, FALSE))
+ status = RtlSetGroupSecurityDescriptor (&sd, group_sid, FALSE);
+ if (!NT_SUCCESS (status))
{
- __seterrno ();
+ __seterrno_from_nt_status (status);
return NULL;
}
debug_printf ("ACL-Size: %d", acl_len);
/* Create DACL for local security descriptor. */
- if (!SetSecurityDescriptorDacl (&sd, TRUE, acl, FALSE))
+ status = RtlSetDaclSecurityDescriptor (&sd, TRUE, acl, FALSE);
+ if (!NT_SUCCESS (status))
{
- __seterrno ();
+ __seterrno_from_nt_status (status);
return NULL;
}