Skip to content

rsync still requires read permission for search-only directories #1064

Description

@FusionPow

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions