Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Dec 1997 01:35:00 +0100
From:      Eivind Eklund <eivind@yes.no>
To:        Darren Reed <darrenr@cyber.com.au>
Cc:        Eivind Eklund <eivind@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-bin@FreeBSD.ORG
Subject:   Re: cvs commit: src/bin/mv mv.c
Message-ID:  <19971211013500.59161@follo.net>
In-Reply-To: <199712110014.LAA23218@plum.cyber.com.au>; from Darren Reed on Thu, Dec 11, 1997 at 11:14:50AM %2B1100
References:  <199712101752.JAA10409@freefall.freebsd.org> <199712110014.LAA23218@plum.cyber.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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 <millert@openbsd.org>
> >   
> >   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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971211013500.59161>