close stdin before running install scripts
libalpm does not guarantee that script output will be presented to the user or that stdin will be connected to a terminal. Close stdin so that scripts do not attempt to use it for user interaction. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
721b785e73
commit
e374e6829c
1 changed files with 1 additions and 0 deletions
|
@ -536,6 +536,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[])
|
||||||
|
|
||||||
if(pid == 0) {
|
if(pid == 0) {
|
||||||
/* this code runs for the child only (the actual chroot/exec) */
|
/* this code runs for the child only (the actual chroot/exec) */
|
||||||
|
close(0);
|
||||||
close(1);
|
close(1);
|
||||||
close(2);
|
close(2);
|
||||||
while(dup2(pipefd[1], 1) == -1 && errno == EINTR);
|
while(dup2(pipefd[1], 1) == -1 && errno == EINTR);
|
||||||
|
|
Loading…
Add table
Reference in a new issue