From owner-svn-src-all@FreeBSD.ORG Fri Jan 6 06:00:18 2012 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 B6EA4106566B; Fri, 6 Jan 2012 06:00:18 +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 568318FC08; Fri, 6 Jan 2012 06:00:18 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so2063384obb.13 for ; Thu, 05 Jan 2012 22:00:17 -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=h7wODd/sxH4swpexBUz9AzNsvASbu9s806UGEYbW9Ik=; b=cpPnGW+OtLegW01zvys27N31tHCYALSPmVcjEDqVIT/nJT92BYJkM+LkUoSIsSo10I kwGop6uRCaS2iM76g6A61N0lGyWCMzODBJ/3bZB9IEOkmVAiHM2sVP9bhDASTwry8sfI e0pw6QIad93fYlbV4VKp0wTb6dLpJQNQ4WxX4= MIME-Version: 1.0 Received: by 10.182.164.106 with SMTP id yp10mr3773920obb.71.1325829617802; Thu, 05 Jan 2012 22:00:17 -0800 (PST) Received: by 10.182.152.6 with HTTP; Thu, 5 Jan 2012 22:00:17 -0800 (PST) In-Reply-To: <4F066340.9010507@FreeBSD.org> References: <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org> Date: Thu, 5 Jan 2012 22:00:17 -0800 Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Guy Helmer Subject: Re: svn commit: r229667 - head/usr.sbin/daemon 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: Fri, 06 Jan 2012 06:00:18 -0000 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 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