Date: Thu, 11 Dec 1997 17:08:50 +1100 From: Bruce Evans <bde@zeta.org.au> To: 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: <199712110608.RAA27951@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
> 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). 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. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712110608.RAA27951>