Check return code of setuid() in timedc.

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

MFC after:	3 days
This commit is contained in:
Simon L. B. Nielsen 2011-04-23 13:57:12 +00:00
parent 11522ca501
commit 1ae2ca130d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=220970

View File

@ -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);