From c19f880d8aac7c0372381e29d7cea09accd0db26 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 12 Feb 2009 01:28:35 +0100 Subject: libxtables: flush before fork Reference: http://bugs.debian.org/514869 Signed-off-by: Jan Engelhardt --- xtables.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xtables.c b/xtables.c index 02bfc17a..d85e6390 100644 --- a/xtables.c +++ b/xtables.c @@ -272,6 +272,12 @@ int xtables_insmod(const char *modname, const char *modprobe, bool quiet) modprobe = buf; } + /* + * Need to flush the buffer, or the child may output it again + * when switching the program thru execv. + */ + fflush(stdout); + switch (fork()) { case 0: argv[0] = (char *)modprobe; -- cgit v1.2.3