From owner-cvs-bin Wed Dec 10 22:16:28 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id WAA07163 for cvs-bin-outgoing; Wed, 10 Dec 1997 22:16:28 -0800 (PST) (envelope-from owner-cvs-bin) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA07144; Wed, 10 Dec 1997 22:16:09 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.6.9) id RAA27951; Thu, 11 Dec 1997 17:08:50 +1100 Date: Thu, 11 Dec 1997 17:08:50 +1100 From: Bruce Evans Message-Id: <199712110608.RAA27951@godzilla.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 Sender: owner-cvs-bin@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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). 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