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);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"