]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: flush before fork
authorJan Engelhardt <jengelh@medozas.de>
Thu, 12 Feb 2009 00:28:35 +0000 (01:28 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Thu, 12 Feb 2009 06:15:07 +0000 (07:15 +0100)
Reference: http://bugs.debian.org/514869
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
xtables.c

index 02bfc17a9c3b79a7853dca45ed631752b4132dbb..d85e63909195c1184d420d4c793d3a9f77b026af 100644 (file)
--- 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;