Skip to content

Commit 1069ad3

Browse files
committed
win32: do not inherit file descriptors
1 parent d5e6ca1 commit 1069ad3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/win32/posix_w32.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,14 @@ GIT_INLINE(int) open_once(
440440
DWORD attributes,
441441
int osf_flags)
442442
{
443-
HANDLE handle = CreateFileW(path, access, sharing, NULL,
443+
SECURITY_ATTRIBUTES security;
444+
int fd;
445+
446+
security.nLength = sizeof(SECURITY_ATTRIBUTES);
447+
security.lpSecurityDescriptor = NULL;
448+
security.bInheritHandle = 0;
449+
450+
HANDLE handle = CreateFileW(path, access, sharing, &security,
444451
creation_disposition, attributes, 0);
445452

446453
if (handle == INVALID_HANDLE_VALUE) {

0 commit comments

Comments
 (0)