When running rsync with root at the source, it is quite possible to end up wanting to transfer directories with 'strange' permissions. At present, it the destination doesn't have root access too, these directories cannot be populated. For example: # mkdir source # mkdir source/dir # touch source/dir/file # chmod 400 source/dir # sudo rsync -rltp source user@host:destination rsync: recv_generator: failed to stat ".../destination/source/dir/file": Permission denied (13) In order to create files in a directory without root, it needs to have u=rwx permissions. There is currently a workaround to temporarily add u+w write permissions to a directory whilst creating files and to correct the permissions afterwards, specifically to deal with read-only directories (u=rx). The attached patch extends this to temporarily add u+rwx permissions instead, allowing all directories to be transferred.
Created attachment 6748 [details] patch described in bug 8342
I have included the patch to have rsync temporarily tweak dirs with u+r and u+x for a non-root receiver, however if a parent dir lacks u+x, any fudged permissions inside subdirs of that directory won't get fixed, and indeed, an incremental recursion copy can tweak the parent dir's permissions back to u-x too soon for the copy to even complete (the latter of which you can work around via --no-inc-recursive because the directory-permission cleanup all happens at the end with --no-i-r). I'll leave this open pending contemplations of a fuller fix, but it may just be that we don't fully support non u+x hierarchies for non-root transfers.