I noticed that rsync itemizes "p" whenever it copies a new file and
finds an alternate basis file whose permissions differ from those to be
applied to the destination file, even when --perms and --executability
are both off. To see this, run the following in an empty directory:
mkdir src dest basis
touch src/file basis/file
chmod 600 src/file
chmod 644 basis/file
rsync -r -ii --link-dest=../basis/ src/file dest/
Rsync correctly makes the hard link but produces the following
bogus-looking itemize output:
hf...p..... file
This is happening because, in "itemize", the generator itemizes
"p"
whenever a file's file-list permissions differ from the permissions in
its stat buffer (those of the existing destination file if any,
otherwise those of the alternate basis file). Before commit b9887818,
this itemization was conditioned on (preserve_perms ||
preserve_executability). Wayne, what was the specific rationale for
removing the condition?
I suppose one could justify unconditionally itemizing a difference
between file-list permissions and an existing destination file since
rsync sets the file-list permissions on the destination file
unconditionally. However, I feel that, for consistency with "o" and
"g"
itemization, rsync should not itemize differences from a basis file
unless they are significant in light of the options. Thus, at least
when "sxp" represents an alternate basis file, "itemize"
should use the
same logic as "unchanged_attrs" to decide whether to itemize
"p".
A second issue: the logic in "unchanged_attrs" needs to be extended so
that an executability difference disqualifies hard links when -E is on.
Matt