Date: Thu, 11 Dec 1997 15:57:09 +0100 From: Eivind Eklund <eivind@yes.no> To: Bruce Evans <bde@zeta.org.au> 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 Message-ID: <19971211155709.48532@follo.net> In-Reply-To: <199712110608.RAA27951@godzilla.zeta.org.au>; from Bruce Evans on Thu, Dec 11, 1997 at 05:08:50PM %2B1100 References: <199712110608.RAA27951@godzilla.zeta.org.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <millert@openbsd.org> > > 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971211155709.48532>