From owner-freebsd-current@FreeBSD.ORG Wed Apr 4 23:29:34 2007 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BCE516A401; Wed, 4 Apr 2007 23:29:34 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk.360sip.com [72.236.70.226]) by mx1.freebsd.org (Postfix) with ESMTP id 06EAA13C459; Wed, 4 Apr 2007 23:29:33 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.47] ([204.244.149.125]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id l34NTTaX041944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 4 Apr 2007 16:29:31 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Message-ID: <461434A6.3080001@FreeBSD.org> Date: Wed, 04 Apr 2007 16:28:38 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Chuck Swiger References: <46128475.9060602@FreeBSD.org> <4613D6F3.4080701@mac.com> In-Reply-To: <4613D6F3.4080701@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Andrew Pantyukhin , FreeBSD Current Subject: Re: Surviving /dev/null disappearance X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2007 23:29:34 -0000 Chuck Swiger wrote: > Andrew Pantyukhin wrote: >> On 4/3/07, Maxim Sobolev wrote: >>> Patch ld(1) to detect the condition and don't unlink the device node? >> >> Yes, but there has to be a generic solution, so that >> we don't reinvent the wheel for every one of the >> thousands apps that may do this. >> >> Isn't there some safety-net wrapper function that >> refuses to remove device nodes and maybe some other >> types of files? > > Why not set a filesystem flag like schg on device nodes under a devfs > tree...? Well, I suspect that it may cause ld(1) fail instead. What we want it to do is to not perform unlink(2) before open(2) when -o argument is device node. -Maxim