Paul Eggert <eggert@cs.ucla.edu> writes:
Since mv ordinarily acts like 'cp --preserve=all' when copying, presumably mv
should warn in this situation if cp warns.
Also, if no mv options other than -i and -f are used, a diagnostic is
needed to conform to the spirit of POSIX, as the POSIX spec says for
this situation "If the duplication of the file characteristics fails
for any reason, mv shall write a diagnostic message to standard error,
but this failure shall not cause mv to modify its exit status."[1]
Contrary to the original bug report POSIX does not require (and
seemingly does not allow) the mv to be aborted if file characteristics
are lost in the copy, but at least the user should be warned about the
situation.
Thanks for the link. POSIX seems pretty clear here.
The attached patch should fix things. I was tempted to add another
option to "struct cp_options", but it was more unwieldy then just
setting "require_preserve_xattr" and special casing "move_mode" to not
change the exit status.