On Linux, rsync still fails to copy an explicitly named file below a directory that is searchable but not readable.
tmp=$(mktemp -d)
mkdir -p "$tmp/src/xonly" "$tmp/dst"
printf 'test\n' > "$tmp/src/xonly/file"
chmod 111 "$tmp/src/xonly"
(cd "$tmp/src" && rsync -aR xonly/file "$tmp/dst/")
This fails with:
rsync: [sender] send_files failed to open ".../src/xonly/file": Permission denied (13)
I would expect the named file to be copied. The process can search xonly and read the file, and this operation does not need to list the directory.
#1052 fixed the same permission issue in ona_open(), but the separate held-directory-fd resolver still opens traversal and parent descriptors with O_RDONLY | O_DIRECTORY. The same issue also affects known-file creation below writable/searchable but unreadable destination directories.
Reproduced on rsync master at 0145b91.
I have a patch and regression test ready for this path.
On Linux, rsync still fails to copy an explicitly named file below a directory that is searchable but not readable.
This fails with:
I would expect the named file to be copied. The process can search
xonlyand read the file, and this operation does not need to list the directory.#1052 fixed the same permission issue in
ona_open(), but the separate held-directory-fd resolver still opens traversal and parent descriptors withO_RDONLY | O_DIRECTORY. The same issue also affects known-file creation below writable/searchable but unreadable destination directories.Reproduced on rsync master at 0145b91.
I have a patch and regression test ready for this path.