Commit 50d3eeae authored by ths's avatar ths
Browse files

Close file descriptors when execing network tap setup script, by

Daniel P. Berrange.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2507 c046a42c-6fe2-441c-8c8c-71466251a162
parent 93815bc2
......@@ -3621,6 +3621,14 @@ static int net_tap_init(VLANState *vlan, const char *ifname1,
pid = fork();
if (pid >= 0) {
if (pid == 0) {
int open_max = sysconf (_SC_OPEN_MAX), i;
for (i = 0; i < open_max; i++)
if (i != STDIN_FILENO &&
i != STDOUT_FILENO &&
i != STDERR_FILENO &&
i != fd)
close(i);
parg = args;
*parg++ = (char *)setup_script;
*parg++ = ifname;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment