It would be nice to drop all privileges in traceroute immediately at
program initialization time, rather than after parsing arguments. I can see
where a few buffer overflows were patched in the parser, but why risk the
possibility of another one? (can you be totally sure that all those string
functions in glibc won't break in any way in the future?)
Here is a patch that moves all privileged operations to the beginning of
main(), and then drops all privileges:
This breaks the '-d' option to traceroute unless you are root, because only
root can set SO_DEBUG. However, I can't get '-d' to do anything useful here
anyway, so I'm not sure if it really matters.
If '-d' actually does do something useful, I can fix that too, let me know.
*** Bug 10517 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of 13466 ***