From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 11 20:36:49 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36E5F51C for ; Wed, 11 Mar 2015 20:36:49 +0000 (UTC) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EE4869E3 for ; Wed, 11 Mar 2015 20:36:48 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id E8E49B80F0; Wed, 11 Mar 2015 21:36:45 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id D491D28494; Wed, 11 Mar 2015 21:36:45 +0100 (CET) Date: Wed, 11 Mar 2015 21:36:45 +0100 From: Jilles Tjoelker To: Matt Tagg Subject: Re: find with -delete option on absolute paths Message-ID: <20150311203645.GA30268@stack.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 20:36:49 -0000 On Tue, Mar 10, 2015 at 08:31:52PM -0700, Matt Tagg wrote: > I believe this was discussed previously (2013), though I could not > find a resolution. > To recap, suppose we try deleting files on an absolute path: > matt@mtbook:/% find /tmp/foo/* -delete > find: -delete: /tmp/foo/bar.txt: relative path potentially not safe > As you can see it gives an error and quits. However if we instead try this: > matt@mtbook:/% gfind /tmp/foo/* -delete > GNU Find throws no error and works as expected ('bar.txt is deleted') > So as an end user, I find this rather confusing. How can I get the > same behavior with BSD Find out of the box? You can get the same behaviour by upgrading to FreeBSD 10 or newer. Before FreeBSD 10.0, find -delete did not allow deleting files given as arguments. This was because of an incorrect check and was fixed in SVN r253886. -- Jilles Tjoelker