From 041708f6436b958eb00f78558956edc8363c1f14 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 6 Feb 2016 10:56:32 +0100 Subject: [PATCH] Revert "Execute pkg scripts via posix_spawn(3)." This reverts commit e33f6354c3aa06745857921e64a0aafeac7aee41. @Gottox pointed out why this won't work. --- NEWS | 3 --- lib/external/fexec.c | 6 +----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 8aa10b6b..bb38547c 100644 --- a/NEWS +++ b/NEWS @@ -11,9 +11,6 @@ xbps-0.52 (???): that is already up-to-date. Fixes #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 anymore because they are executed with "/bin/sh" directly. That means "/tmp" can be mounted as "noexec". Fixed #149 correctly. diff --git a/lib/external/fexec.c b/lib/external/fexec.c index cc2cf166..00eff213 100644 --- a/lib/external/fexec.c +++ b/lib/external/fexec.c @@ -37,7 +37,6 @@ #include #include #include -#include #undef _DEFAULT_SOURCE #undef _BSD_SOURCE @@ -49,10 +48,7 @@ pfcexec(struct xbps_handle *xhp, const char *file, const char **argv) pid_t child; int status; - if (posix_spawn(&child, file, NULL, NULL, - (char* const*)__UNCONST(argv), NULL) != 0) - return -1; - + child = vfork(); switch (child) { case 0: /*