Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jun 1995 03:14:55 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        hackers@freebsd.org, witr@rwwa.com
Subject:   Re: Strance mv error message
Message-ID:  <199506221714.DAA06122@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>bash$ mv /tmp/foo ~/foo
>mv: /home/witr/foo: set owner/group: Operation not permitted
>bash$ ls -l foo
>-rw-r-----  1 witr  witr  0 Jun 20 12:16 foo

>mv(1) says that a move across filesystems is like a cp -pr, and
>cp(1) says:

>     -p    Causes cp to preserve in the copy as many of the modification time,
>           access time, file flags, file mode, user ID, and group ID as al-
>           lowed by permissions.

>           If the user ID and group ID cannot be preserved, no error message
>           is displayed and the exit value is not altered.

>So, why the error message?

The man page for mv is apparently out of date.  mv uses fastcopy() to
move single files across file systems and in BSD4.4lite fastcopy() is
fussier than `cp -p'.  This may be a bug.  mv uses `cp -PRp', not `cp
-pr', to move directories across file systems.  The -r flag is
deprecated.  This is a bug in mv.1.  Note that moving directories across
file systems is broken.  Hard links are snapped, the sticky bit is not
preserved, not all modification times are preserved, ...  These bugs are
all in `cp -PRp'.  Bad things also happen when setuid or immutable bits
can't be preserved.

Bruce



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