ash: fix redir_leak.tests if STANDALONE=y

If STANDALONE and we run a NOEXEC applet, saved copies of redirected fds
were visible for the child. They have CLOEXEC bit, yes, but we do not exec
in this case.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-07-26 13:42:53 +02:00
parent b0648b0e78
commit b31b61bb9b

View File

@ -7698,6 +7698,7 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **
clearenv();
while (*envp)
putenv(*envp++);
popredir(/*drop:*/ 1, /*restore:*/ 0);
run_applet_no_and_exit(applet_no, cmd, argv);
}
/* re-exec ourselves with the new arguments */