Cygwin: use NULL security descriptor in InitializeObjectAttributes

Using sec_none{_nih} is just a roundabout way to specify a
NULL SD.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2019-02-25 21:06:15 +01:00
parent 98afd02be3
commit 3b3ba558e9
3 changed files with 4 additions and 8 deletions

@ -58,8 +58,7 @@ mkdirs (PWCHAR ntdirname, int lastsepcount)
UNICODE_STRING dn; UNICODE_STRING dn;
RtlInitUnicodeString (&dn, ntdirname); RtlInitUnicodeString (&dn, ntdirname);
OBJECT_ATTRIBUTES oa; OBJECT_ATTRIBUTES oa;
InitializeObjectAttributes (&oa, &dn, 0, NULL, InitializeObjectAttributes (&oa, &dn, 0, NULL, NULL);
sec_none_nih.lpSecurityDescriptor);
HANDLE dh = NULL; HANDLE dh = NULL;
NTSTATUS status; NTSTATUS status;
IO_STATUS_BLOCK iosb; IO_STATUS_BLOCK iosb;
@ -765,8 +764,7 @@ dll_list::create_forkables ()
RtlInitUnicodeString (&fn, ntname); RtlInitUnicodeString (&fn, ntname);
OBJECT_ATTRIBUTES oa; OBJECT_ATTRIBUTES oa;
InitializeObjectAttributes (&oa, &fn, 0, NULL, InitializeObjectAttributes (&oa, &fn, 0, NULL, NULL);
sec_none_nih.lpSecurityDescriptor);
HANDLE hlocal = NULL; HANDLE hlocal = NULL;
NTSTATUS status; NTSTATUS status;
IO_STATUS_BLOCK iosb; IO_STATUS_BLOCK iosb;

@ -145,8 +145,7 @@ CreateMapping (HANDLE fhdl, size_t len, off_t off, DWORD openflags,
ULONG attributes = attached (prot) ? SEC_RESERVE : SEC_COMMIT; ULONG attributes = attached (prot) ? SEC_RESERVE : SEC_COMMIT;
OBJECT_ATTRIBUTES oa; OBJECT_ATTRIBUTES oa;
InitializeObjectAttributes (&oa, NULL, OBJ_INHERIT, NULL, InitializeObjectAttributes (&oa, NULL, OBJ_INHERIT, NULL, NULL);
sec_none.lpSecurityDescriptor);
if (fhdl == INVALID_HANDLE_VALUE) if (fhdl == INVALID_HANDLE_VALUE)
{ {

@ -306,8 +306,7 @@ timer_tracker::settime (int flags, const itimerspec *new_value,
{ {
OBJECT_ATTRIBUTES attr; OBJECT_ATTRIBUTES attr;
InitializeObjectAttributes (&attr, NULL, 0, NULL, InitializeObjectAttributes (&attr, NULL, 0, NULL, NULL);
sec_none_nih.lpSecurityDescriptor);
status = NtCreateEvent (&cancel_evt, EVENT_ALL_ACCESS, &attr, status = NtCreateEvent (&cancel_evt, EVENT_ALL_ACCESS, &attr,
NotificationEvent, FALSE); NotificationEvent, FALSE);
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))