Avoid using vfork(2) in the DSO system(3) wrapper.

Traditional vfork(2) semantics make it unsafe for use for more than
just vfork(2) + execve(2).
This commit is contained in:
Todd C. Miller
2022-06-03 09:43:34 -06:00
parent 06bf1be67c
commit 25a26f5042
4 changed files with 2 additions and 11 deletions

View File

@@ -52,10 +52,6 @@
#include "sudo_util.h"
#include "pathnames.h"
#ifndef HAVE_VFORK
# define vfork fork
#endif
/* execl flavors */
#define SUDO_EXECL 0x0
#define SUDO_EXECLE 0x1
@@ -249,7 +245,7 @@ system_wrapper(const char *cmnd)
if (sigprocmask(SIG_BLOCK, &mask, &omask) == -1)
debug_return_int(-1);
switch (child = vfork()) {
switch (child = fork()) {
case -1:
/* error */
(void)sigprocmask(SIG_SETMASK, &omask, NULL);