oping: Drop root privileges as soon as possible.
authorFlorian Forster <octo@verplant.org>
Wed, 12 Jul 2006 06:50:23 +0000 (08:50 +0200)
committerFlorian Forster <octo@verplant.org>
Wed, 12 Jul 2006 06:50:23 +0000 (08:50 +0200)
src/oping.c

index d4469a8..3201e85 100644 (file)
@@ -322,6 +322,9 @@ int main (int argc, char **argv)
                }
        }
 
+       /* Drop root privileges if we're setuid-root. */
+       setuid (getuid ());
+
        i = 0;
        for (iter = ping_iterator_get (ping);
                        iter != NULL;