From owner-cvs-bin Wed Dec 10 16:35:25 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA09610 for cvs-bin-outgoing; Wed, 10 Dec 1997 16:35:25 -0800 (PST) (envelope-from owner-cvs-bin) Received: from ns1.yes.no (ns1.yes.no [195.119.24.10]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA09592; Wed, 10 Dec 1997 16:35:08 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [194.198.43.36]) by ns1.yes.no (8.8.7/8.8.7) with ESMTP id AAA26838; Thu, 11 Dec 1997 00:35:05 GMT Received: (from eivind@localhost) by bitbox.follo.net (8.8.6/8.8.6) id BAA24274; Thu, 11 Dec 1997 01:35:04 +0100 (MET) Message-ID: <19971211013500.59161@follo.net> Date: Thu, 11 Dec 1997 01:35:00 +0100 From: Eivind Eklund To: Darren Reed Cc: Eivind Eklund , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-bin@FreeBSD.ORG Subject: Re: cvs commit: src/bin/mv mv.c References: <199712101752.JAA10409@freefall.freebsd.org> <199712110014.LAA23218@plum.cyber.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e In-Reply-To: <199712110014.LAA23218@plum.cyber.com.au>; from Darren Reed on Thu, Dec 11, 1997 at 11:14:50AM +1100 Sender: owner-cvs-bin@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > eivind 1997/12/10 09:52:54 PST > > > > Modified files: > > bin/mv mv.c > > Log: > > Merge from OpenBSD: > > > Error out if someone tries to mv a mount point. Old behavior was to > > > move all files contained in the mounted filesystem to the dest. dir > > > which could be quite nasty. Personally, I think rename(2) should > > > return EPERM or EINVAL instead of EXDEV. > > > > Obtained from: OpenBSD mv.c rev 1.6 by Todd Miller > > > > Revision Changes Path > > 1.17 +16 -2 src/bin/mv/mv.c > > This change doesn't stop mv moving directories, in general, accross > filesystems, does it ? No. It does a statfs() and checks if the source is exactly equal to the file system mount point; if it is, it refuse with mv: cannot rename a mount point There is one other added fail-case: When the system is unable to resolve the source file through realpath(3). Eivind.