Skip to content

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

Open
shankerwangmiao wants to merge 1 commit into
RsyncProject:masterfrom
shankerwangmiao:add-testsuit
Open

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

Conversation

@shankerwangmiao
Copy link
Copy Markdown

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.
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.

1 participant