Skip to content

Defensive directory-tree walk might be too defensive #1081

Description

@4z3

Since upgrading to 3.5.0, unreadable directories cause unexpected behavior.

Exhibit 1: filters don't get applied when unreadable directories are involved

$ mkdir -p /tmp/intermediary/src
$ sudo chown root: /tmp/intermediary
$ sudo chmod 711 /tmp/intermediary
$ echo - derp > /tmp/intermediary/src/.rsync-filter
$ touch /tmp/intermediary/src/derp
$ rsync --itemize-changes -aF /tmp/intermediary/src/ /tmp/dst/
>f..t...... .rsync-filter
>f..t...... derp  <---- should not be transferred

Exhibit 2: destination below unreadable directory cannot be used

$ mkdir -p /tmp/intermediary2/src /tmp/intermediary2/dst
$ sudo chown root: /tmp/intermediary2
$ sudo chmod 711 /tmp/intermediary2
$ rsync -a /tmp/intermediary2/src/ /tmp/intermediary2/dst
rsync: [Receiver] change_dir#1 "/tmp/intermediary2/dst" failed: Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(768) [Receiver=3.5.0]

Both cases execute as expected when making /tmp/intermediary* readable or using --insecure-links.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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