Check return code of setuid() in traceroute.

While it will not fail in normal circumstances, better safe than sorry.

Reported by:	LLVM's clang static analyzer
MFC after:	3 days
This commit is contained in:
Simon L. B. Nielsen 2011-04-23 13:07:35 +00:00
parent c65c068a5f
commit 04e7229db5

View File

@ -509,7 +509,10 @@ main(int argc, char **argv)
sockerrno = errno;
}
setuid(getuid());
if (setuid(getuid()) != 0) {
perror("setuid()");
exit(1);
}
#ifdef IPCTL_DEFTTL
{