Execute pkg scripts via posix_spawn(3).
This commit is contained in:
parent
bd00a0b096
commit
e33f6354c3
3
NEWS
3
NEWS
@ -1,5 +1,8 @@
|
||||
xbps-0.52 (???):
|
||||
|
||||
* libxbps: package INSTALL/REMOVE scripts are now executed via
|
||||
posix_spawn(3), replacing vfork(3).
|
||||
|
||||
* libxbps: package INSTALL/REMOVE scripts do not need to be executables
|
||||
anymore because they are executed with "/bin/sh" directly. That means
|
||||
"/tmp" can be mounted as "noexec". Fixed #149 correctly.
|
||||
|
6
lib/external/fexec.c
vendored
6
lib/external/fexec.c
vendored
@ -37,6 +37,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <spawn.h>
|
||||
|
||||
#undef _DEFAULT_SOURCE
|
||||
#undef _BSD_SOURCE
|
||||
@ -48,7 +49,10 @@ pfcexec(struct xbps_handle *xhp, const char *file, const char **argv)
|
||||
pid_t child;
|
||||
int status;
|
||||
|
||||
child = vfork();
|
||||
if (posix_spawn(&child, file, NULL, NULL,
|
||||
(char* const*)__UNCONST(argv), NULL) != 0)
|
||||
return -1;
|
||||
|
||||
switch (child) {
|
||||
case 0:
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user