From owner-cvs-src@FreeBSD.ORG Thu Dec 27 21:54:15 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CABDE16A418; Thu, 27 Dec 2007 21:54:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by mx1.freebsd.org (Postfix) with ESMTP id 5726413C442; Thu, 27 Dec 2007 21:54:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-219-213.carlnfd3.nsw.optusnet.com.au (c211-30-219-213.carlnfd3.nsw.optusnet.com.au [211.30.219.213]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id lBRLsAfc002713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Dec 2007 08:54:13 +1100 Date: Fri, 28 Dec 2007 08:54:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Diomidis Spinellis In-Reply-To: <200712271133.lBRBXhjY038891@repoman.freebsd.org> Message-ID: <20071228083650.L17488@delplex.bde.org> References: <200712271133.lBRBXhjY038891@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/mv mv.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 21:54:15 -0000 On Thu, 27 Dec 2007, Diomidis Spinellis wrote: > dds 2007-12-27 11:33:42 UTC > > FreeBSD src repository > > Modified files: > bin/mv mv.c > Log: > - Roll-back attempts to mimic rename(2) atomicity introduced in 1.47, > and follow the letter of the POSIX specification. > > - Moving a directory to an existing non-empty directory will now fail, > as required. It should be noted that the previous behaviour was very dangerous. It could destroy target directory trees of any size in order to replace them with a typo, but of course a local rename() can only destroy the target directory tree if that tree consists of an empty target directory. The destroyed target directory tree cannot quite be /, but it can be almost as important: mkdir /tmp/usr cd /tmp mv usr / # when /tmp and /usr are on different fs's. # this replaced /usr by the empty usr, # using esentially the following: mv /usr /usr.backup cp -pRp usr / rm -rf /usr.backup rm -rf usr Bruce