projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
block uid/gid changes during posix_spawn
[musl]
/
src
/
process
/
posix_spawn.c
diff --git
a/src/process/posix_spawn.c
b/src/process/posix_spawn.c
index
604756e
..
8a6ff6d
100644
(file)
--- a/
src/process/posix_spawn.c
+++ b/
src/process/posix_spawn.c
@@
-5,9
+5,16
@@
#include <fcntl.h>
#include "syscall.h"
#include "fdop.h"
#include <fcntl.h>
#include "syscall.h"
#include "fdop.h"
+#include "libc.h"
extern char **environ;
extern char **environ;
+static void dummy_0()
+{
+}
+weak_alias(dummy_0, __acquire_ptc);
+weak_alias(dummy_0, __release_ptc);
+
pid_t __vfork(void);
int __posix_spawnx(pid_t *restrict res, const char *restrict path,
pid_t __vfork(void);
int __posix_spawnx(pid_t *restrict res, const char *restrict path,
@@
-24,7
+31,10
@@
int __posix_spawnx(pid_t *restrict res, const char *restrict path,
if (!attr) attr = &dummy_attr;
sigprocmask(SIG_BLOCK, (void *)(uint64_t []){-1}, &oldmask);
if (!attr) attr = &dummy_attr;
sigprocmask(SIG_BLOCK, (void *)(uint64_t []){-1}, &oldmask);
+
+ __acquire_ptc();
pid = __vfork();
pid = __vfork();
+ __release_ptc();
if (pid) {
sigprocmask(SIG_SETMASK, &oldmask, 0);
if (pid) {
sigprocmask(SIG_SETMASK, &oldmask, 0);