Revert "Execute pkg scripts via posix_spawn(3)."

This reverts commit e33f6354c3.

@Gottox pointed out why this won't work.
This commit is contained in:
Juan RP 2016-02-06 10:56:32 +01:00
parent 9ec32ec5e3
commit 041708f643
2 changed files with 1 additions and 8 deletions

3
NEWS
View File

@ -11,9 +11,6 @@ xbps-0.52 (???):
that is already up-to-date. Fixes #145. that is already up-to-date. Fixes #145.
See https://github.com/voidlinux/xbps/issues/145 See https://github.com/voidlinux/xbps/issues/145
* 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 * libxbps: package INSTALL/REMOVE scripts do not need to be executables
anymore because they are executed with "/bin/sh" directly. That means anymore because they are executed with "/bin/sh" directly. That means
"/tmp" can be mounted as "noexec". Fixed #149 correctly. "/tmp" can be mounted as "noexec". Fixed #149 correctly.

View File

@ -37,7 +37,6 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <spawn.h>
#undef _DEFAULT_SOURCE #undef _DEFAULT_SOURCE
#undef _BSD_SOURCE #undef _BSD_SOURCE
@ -49,10 +48,7 @@ pfcexec(struct xbps_handle *xhp, const char *file, const char **argv)
pid_t child; pid_t child;
int status; int status;
if (posix_spawn(&child, file, NULL, NULL, child = vfork();
(char* const*)__UNCONST(argv), NULL) != 0)
return -1;
switch (child) { switch (child) {
case 0: case 0:
/* /*