Autoconf folks, the comment on 'mv' in the Portable Shell section of the new
manual might not be appropriate:
`mv'
The only portable options are `-f' and `-i'.
Moving individual files between file systems is portable (it was
in V6), but it is not always atomic: when doing `mv new existing',
there's a critical section where neither the old nor the new
version of `existing' actually exists.
Moving directories across mount points is not portable, use `cp'
and `rm'.
Since it's not uncommon to have a build dir in /tmp, this fails on BSD with an
NFS mounted home due to /tmp's default group ownership of wheel (root) and the
default setgid behavior of its directories. Well, it copies the file but outputs
error messages since root group ownership can't be set via NFS. cp;rm should
probably be the recommended approach if the relative positioning of the files is
unknown.
See the example below the following quote for the scripted version of the failure.
Raja R Harinath wrote:
> > Hmm. Well, at least on my FreeBSD 4.2 system with my home directory
> > NFS mounted from Linux, I get chown errors when attempting an mv from /tmp to
> > /home, though the file does get moved.
> >
> > I seem to remember something similar on an old Sun, but that was a long time
> > ago and it may have been a directory I was trying to move.
>
> Hmm...
>
> That may be a good thing to point out to the 'autoconf' folks, to
> update their documentation about.
>
> If I'm not mistaken, most NFS mounts squelch root. So, if you were
> moving a 'root' owned file from /tmp to an NFS mount on /home, the
> corresponding chown to root would fail. This situation probably won't
> occur when building CVS, I guess.
Not owned, but the /tmp directory is using BSD's setgid mode, so the group owner
of the file is root (well, 'wheel' on my BSD, but it is gid 0):
> cd
> touch /tmp/myfile
> mv /tmp/myfile .
mv: ./myfile: set owner/group (was: 506/0): Operation not permitted
> df -k /tmp .
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ad0s1a 168639 34584 120564 22% /
empress:/home 18271560 10569496 6773912 61% /home
> ls -ld /tmp
drwxrwxrwt 6 root wheel 512 Jan 19 15:29 /tmp
I cc'd the autoconf folks, as if you hadn't noticed. :)
Derek
--
Derek Price CVS Solutions Architect ( http://CVSHome.org )
mailto:[EMAIL PROTECTED] OpenAvenue ( http://OpenAvenue.com )
--
I will not Xerox my butt.
I will not Xerox my butt.
I will not Xerox my butt...
- Bart Simpson on chalkboard, _The Simpsons_