Code

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 d4469a8f94f4744a4f5e77c8e40f62c44354b39a..3201e85dc0f8808268f467d4337ae9a137d7ee64 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;