Skip to content

receiver: try to chmod the target file when denied opening#957

Merged
tridge merged 1 commit into
RsyncProject:masterfrom
shankerwangmiao:add-testsuit
Jun 5, 2026
Merged

receiver: try to chmod the target file when denied opening#957
tridge merged 1 commit into
RsyncProject:masterfrom
shankerwangmiao:add-testsuit

Conversation

@shankerwangmiao
Copy link
Copy Markdown
Contributor

When the target file exists but its permission modes prevent us from opening it for writing, we can try first to chmod it and then open it.

This happens under the following conditions:

  1. rsync is started with --partial and --delay-updates, so that transferred files are saved in the .~tmp~/ directory
  2. the permission modes of some of the files are preventing the owner from writing into it, e.g. 0444
  3. the files which has already been transferred is stored in the .~tmp~/ directory, with their mode set to the same as the source
  4. rsync is interrupted, so that such files remain in the .~tmp~/ directory
  5. rsync is started again, while this time, rsync is unable to open the files in the .~tmp~/ directory for writing, because of the permission modes.

When the target file exists but its permission modes prevent us from
opening it for writing, we can try first to chmod it and then open it.
@tridge
Copy link
Copy Markdown
Member

tridge commented Jun 5, 2026

@shankerwangmiao I made some tweaks to your PR, thanks for your contribution!

@tridge tridge merged commit c1d7b5c into RsyncProject:master Jun 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants