From owner-cvs-bin Thu Dec 11 06:58:56 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA17648 for cvs-bin-outgoing; Thu, 11 Dec 1997 06:58:56 -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 GAA17504; Thu, 11 Dec 1997 06:57:25 -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 OAA05494; Thu, 11 Dec 1997 14:57:10 GMT Received: (from eivind@localhost) by bitbox.follo.net (8.8.6/8.8.6) id PAA27230; Thu, 11 Dec 1997 15:57:09 +0100 (MET) Message-ID: <19971211155709.48532@follo.net> Date: Thu, 11 Dec 1997 15:57:09 +0100 From: Eivind Eklund To: Bruce Evans Cc: cvs-all@FreeBSD.ORG, cvs-bin@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, eivind@FreeBSD.ORG Subject: Re: cvs commit: src/bin/mv mv.c References: <199712110608.RAA27951@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e In-Reply-To: <199712110608.RAA27951@godzilla.zeta.org.au>; from Bruce Evans on Thu, Dec 11, 1997 at 05:08:50PM +1100 Sender: owner-cvs-bin@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Thu, Dec 11, 1997 at 05:08:50PM +1100, Bruce Evans wrote: > > 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 > > This seems to break POSIX conformance. According to a POSIX.2 draft, > mv(1) shall attempt to move the entire subtree if rename(2) returns > EXDEV, and according to POSIX.1-1990, rename(2) shall return EXDEV for > cross-device moves (unless certain other error conditions not related > to cross-device moves occur). Does this mean I should revert it? (Personally, I think I could have tried to move a mount-point in the belief that it belonged to the parent directory - finding later that I'd blown 2 GB of data into / would have made me `slightly irritated'. I think this is a good change. However, if we are compliant in most other cases, I'll let that pass for the chance of getting that nice little stamp ;-) > Moving entire subtrees is probably wrong in all cases. Subtrees may be > huge, and they may contain mount points even if the root is not a mount > point. ... or does this mean that the patch should be extended to make mv even more restrictive? Eivind.