From owner-freebsd-stable@FreeBSD.ORG Wed Sep 26 02:03:00 2007 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B421B16A417 for ; Wed, 26 Sep 2007 02:03:00 +0000 (UTC) (envelope-from fbsdlists@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.226]) by mx1.freebsd.org (Postfix) with ESMTP id 4D0A113C44B for ; Wed, 26 Sep 2007 02:03:00 +0000 (UTC) (envelope-from fbsdlists@gmail.com) Received: by wr-out-0506.google.com with SMTP id 70so759071wra for ; Tue, 25 Sep 2007 19:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=j/YfjFdfbQYG4HWGeMZtFU0mJRxuw+X+mkvYKbOJ+4g=; b=FSF6iv1d84y7xwv+fGxXCCkfO99ew/xhjrnTkXuiZ8elsqaltLAWSVwWvuf9E/lM4aD7Z3zkH3ss3GRmtz5DS/UFfSQ3+TqI0qtgJ6ThJRGCGpw5TjtDlgX9LRTcusVC1tGqGIG5LdT9SZuc/at+88cDUOHBTvEi1fGnHiO73S0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QiNTifIDIRoLraPPYFpXzzmkoWThaCBqAid5ddF0IkJFHWnzJ6oC4Klrn8nSdtoPFdB0+csWeQZQtJ6tzreKTfhv8JaR9NR3Cme/zw/Epc9WFK0WSsD2x84sBljNCwSet1eRC0rZyoNaVF2xyz8678JMQ8TQfiqLXLtg9IVEkgk= Received: by 10.142.77.11 with SMTP id z11mr71989wfa.1190770711050; Tue, 25 Sep 2007 18:38:31 -0700 (PDT) Received: by 10.142.12.14 with HTTP; Tue, 25 Sep 2007 18:38:30 -0700 (PDT) Message-ID: <54db43990709251838q68bdba95iefefb43029761c34@mail.gmail.com> Date: Tue, 25 Sep 2007 21:38:30 -0400 From: "Bob Johnson" To: freebsd-stable@freebsd.org In-Reply-To: <200709251743.l8PHhvlP012244@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070925173634.89748abe.torfinn.ingolfsen@broadpark.no> <200709251743.l8PHhvlP012244@lurza.secnetix.de> Subject: Re: rm(1) bug, possibly serious X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 02:03:00 -0000 On 9/25/07, Oliver Fromme wrote: > Torfinn Ingolfsen wrote: > > Oliver Fromme wrote: > > > > > $ cd /tmp > > > $ mkdir -p foo/var > > > $ cd foo/bar > > > $ rm -rf ../ > > > rm: ../: Invalid argument > > > $ rm -rf ../ > > > $ > > > [...] > > Quick testing here: > > [...] > > Ok, I think it is a bug. > > Yes, I think so, too. > > By the way, an additional confusion is that ".." and "../" > are handled differently. Specifying ".." always leads to > this message: > > rm: "." and ".." may not be removed > > and nothing is actually removed. It is confusing that > adding a slash leads to a different error message _and_ > removal of the contents of the parent directory. Clearly > a POLA violation. Maybe. But I expect that the behavior for "rm -rf .." is there so that things don't get REALLY astonishing when you do "rm -rf *". Having a different behavior for "rm -rf ../" may have been intentional on someone's part so you can override the protection if you really want to. - Bob