Date: Thu, 5 Jan 2012 22:50:13 GMT From: dfilter@FreeBSD.ORG (dfilter service) To: freebsd-bugs@FreeBSD.org Subject: Re: bin/159568: commit references a PR Message-ID: <201201052250.q05MoD23035750@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/159568; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/159568: commit references a PR Date: Thu, 5 Jan 2012 22:48:46 +0000 (UTC) Author: ghelmer Date: Thu Jan 5 22:48:36 2012 New Revision: 229667 URL: http://svn.freebsd.org/changeset/base/229667 Log: Allow daemon(8) to run pidfile_open() before relenquishing privileges so pid files can be written in /var/run when started as root. I do not expect this to cause any security issues, but if anyone objects it could be easily reverted. PR: bin/159568 MFC after: 4 weeks Modified: head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Thu Jan 5 22:31:25 2012 (r229666) +++ head/usr.sbin/daemon/daemon.c Thu Jan 5 22:48:36 2012 (r229667) @@ -79,9 +79,6 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - if (user != NULL) - restrict_process(user); - /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently @@ -97,6 +94,9 @@ main(int argc, char *argv[]) } } + if (user != NULL) + restrict_process(user); + if (daemon(nochdir, noclose) == -1) err(1, NULL); _______________________________________________ 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-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201052250.q05MoD23035750>