Author: simon Date: Sat Apr 23 13:07:35 2011 New Revision: 220968 URL: http://svn.freebsd.org/changeset/base/220968
Log: 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 Modified: head/contrib/traceroute/traceroute.c Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Sat Apr 23 11:22:48 2011 (r220967) +++ head/contrib/traceroute/traceroute.c Sat Apr 23 13:07:35 2011 (r220968) @@ -509,7 +509,10 @@ main(int argc, char **argv) sockerrno = errno; } - setuid(getuid()); + if (setuid(getuid()) != 0) { + perror("setuid()"); + exit(1); + } #ifdef IPCTL_DEFTTL { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"