Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6d366ce7
Commit
6d366ce7
authored
Sep 13, 2023
by
Brendan Shanks
Committed by
Alexandre Julliard
Sep 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msv1_0: Implement ntlm_fork() using posix_spawn().
parent
d18fd2c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
unixlib.c
dlls/msv1_0/unixlib.c
+21
-17
No files found.
dlls/msv1_0/unixlib.c
View file @
6d366ce7
...
...
@@ -28,6 +28,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <spawn.h>
#include <sys/wait.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
...
...
@@ -39,6 +40,8 @@
#include "wine/debug.h"
#include "unixlib.h"
extern
char
**
environ
;
WINE_DEFAULT_DEBUG_CHANNEL
(
ntlm
);
WINE_DECLARE_DEBUG_CHANNEL
(
winediag
);
...
...
@@ -155,6 +158,7 @@ static NTSTATUS ntlm_fork( void *args )
{
const
struct
fork_params
*
params
=
args
;
struct
ntlm_ctx
*
ctx
=
params
->
ctx
;
posix_spawn_file_actions_t
file_actions
;
int
pipe_in
[
2
],
pipe_out
[
2
];
#ifdef HAVE_PIPE2
...
...
@@ -179,29 +183,29 @@ static NTSTATUS ntlm_fork( void *args )
fcntl
(
pipe_out
[
1
],
F_SETFD
,
FD_CLOEXEC
);
}
if
(
!
(
ctx
->
pid
=
fork
()))
/* child */
{
dup2
(
pipe_out
[
0
],
0
);
close
(
pipe_out
[
0
]
);
close
(
pipe_out
[
1
]
);
posix_spawn_file_actions_init
(
&
file_actions
);
dup2
(
pipe_in
[
1
],
1
);
close
(
pipe_in
[
0
]
);
close
(
pipe_in
[
1
]
);
posix_spawn_file_actions_adddup2
(
&
file_actions
,
pipe_out
[
0
],
0
);
posix_spawn_file_actions_addclose
(
&
file_actions
,
pipe_out
[
0
]
);
posix_spawn_file_actions_addclose
(
&
file_actions
,
pipe_out
[
1
]
);
execvp
(
params
->
argv
[
0
],
params
->
argv
);
posix_spawn_file_actions_adddup2
(
&
file_actions
,
pipe_in
[
1
],
1
);
posix_spawn_file_actions_addclose
(
&
file_actions
,
pipe_in
[
0
]
);
posix_spawn_file_actions_addclose
(
&
file_actions
,
pipe_in
[
1
]
);
write
(
1
,
"BH
\n
"
,
3
);
_exit
(
1
);
}
else
if
(
posix_spawnp
(
&
ctx
->
pid
,
params
->
argv
[
0
],
&
file_actions
,
NULL
,
params
->
argv
,
environ
))
{
ctx
->
pipe_in
=
pipe_in
[
0
];
close
(
pipe_in
[
1
]
);
ctx
->
pipe_out
=
pipe_out
[
1
];
close
(
pipe_out
[
0
]
);
ctx
->
pid
=
-
1
;
write
(
pipe_in
[
1
],
"BH
\n
"
,
3
);
}
ctx
->
pipe_in
=
pipe_in
[
0
];
close
(
pipe_in
[
1
]
);
ctx
->
pipe_out
=
pipe_out
[
1
];
close
(
pipe_out
[
0
]
);
posix_spawn_file_actions_destroy
(
&
file_actions
);
return
SEC_E_OK
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment