From owner-svn-src-all@FreeBSD.ORG Sat Apr 23 13:57:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D61D7106566B; Sat, 23 Apr 2011 13:57:12 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C07958FC13; Sat, 23 Apr 2011 13:57:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3NDvCoR092035; Sat, 23 Apr 2011 13:57:12 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3NDvCk1092033; Sat, 23 Apr 2011 13:57:12 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201104231357.p3NDvCk1092033@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sat, 23 Apr 2011 13:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220970 - head/usr.sbin/timed/timedc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2011 13:57:12 -0000 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);