From owner-svn-src-head@FreeBSD.ORG Wed Jan 11 02:43:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D0481065672; Wed, 11 Jan 2012 02:43:52 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 04FC28FC1A; Wed, 11 Jan 2012 02:43:51 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so477125obb.13 for ; Tue, 10 Jan 2012 18:43:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=edS6qsfiso8QYHh65J9zyRJoFt6jvnV4CXLUzlhCA6g=; b=vWLnrPBj+OuTELu1OD5eQfJ7kCJ6ZiUVXXwNvobSKUh1cIndrtS6JMFln8Q2JBbufi P4QRavjXN31bpe9MN6di/siYXtsyhrbE8Gf8+yjf91CbxWjojogBcU1zUSThOb9P9PIS c1sEZ8WiNBx0jZ0C7BsllEFyqiSOnqDUphJ7Q= MIME-Version: 1.0 Received: by 10.182.2.169 with SMTP id 9mr20710775obv.79.1326249831526; Tue, 10 Jan 2012 18:43:51 -0800 (PST) Received: by 10.182.152.6 with HTTP; Tue, 10 Jan 2012 18:43:51 -0800 (PST) In-Reply-To: References: <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org> Date: Tue, 10 Jan 2012 18:43:51 -0800 Message-ID: From: Garrett Cooper To: Guy Helmer Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 02:43:52 -0000 On Tue, Jan 10, 2012 at 1:01 PM, Guy Helmer wrote: > On Jan 6, 2012, at 12:00 AM, Garrett Cooper wrote: > >> On Thu, Jan 5, 2012 at 6:58 PM, Doug Barton wrote: >>> On 01/05/2012 14:48, Guy Helmer wrote: >>>> =A0 Allow daemon(8) to run pidfile_open() before relenquishing privile= ges >>>> =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 b= e >>> 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? >> >> =A0 =A0As 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... > > I just added an fcntl(=85, FD_CLOEXEC) call to pidfile_open() so this par= ticular problem should be resolved. I saw -- thanks! -Garrett