svn commit: r220970 - head/usr.sbin/timed/timedc
Simon L. Nielsen
simon at FreeBSD.org
Sat Apr 23 13:57:12 UTC 2011
Author: simon
Date: Sat Apr 23 13:57:12 2011
New Revision: 220970
URL: http://svn.freebsd.org/changeset/base/220970
Log:
Check return code of setuid() in timedc.
While it will not fail in normal circumstances, better safe than
sorry.
MFC after: 3 days
Modified:
head/usr.sbin/timed/timedc/timedc.c
Modified: head/usr.sbin/timed/timedc/timedc.c
==============================================================================
--- head/usr.sbin/timed/timedc/timedc.c Sat Apr 23 13:42:03 2011 (r220969)
+++ head/usr.sbin/timed/timedc/timedc.c Sat Apr 23 13:57:12 2011 (r220970)
@@ -75,7 +75,8 @@ main(argc, argv)
*/
if (priv_resources() < 0)
errx(1, "could not get privileged resources");
- (void) setuid(getuid());
+ if (setuid(getuid()) != 0)
+ err(1, "setuid()");
if (--argc > 0) {
c = getcmd(*++argv);
More information about the svn-src-all
mailing list