Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jan 2012 22:00:17 -0800
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Doug Barton <dougb@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Guy Helmer <ghelmer@freebsd.org>
Subject:   Re: svn commit: r229667 - head/usr.sbin/daemon
Message-ID:  <CAGH67wQueBvWCHoabO8m79jAzds%2ButaZDPLjX4VAO1iYBaiy-Q@mail.gmail.com>
In-Reply-To: <4F066340.9010507@FreeBSD.org>
References:  <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 5, 2012 at 6:58 PM, Doug Barton <dougb@freebsd.org> wrote:
> On 01/05/2012 14:48, Guy Helmer wrote:
>> =A0 Allow daemon(8) to run pidfile_open() before relenquishing privilege=
s
>> =A0 so pid files can be written in /var/run when started as root.
>
> I'm not sure how useful this is since when daemon is exiting it won't be
> able to remove the pid file (unless I'm missing something).
>
> Isn't it better to pre-create the pid file with the proper permissions
> for the unprivileged user?

    As another aside, the file descriptor never has fcntl(,
FD_CLOEXEC) run on it, so it leaks the file descriptors across execs..
that's not good...
Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGH67wQueBvWCHoabO8m79jAzds%2ButaZDPLjX4VAO1iYBaiy-Q>