Bug 5190 - rsyncd can't unlink dir structure when only the group has write permission
Summary: rsyncd can't unlink dir structure when only the group has write permission
Status: RESOLVED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.9
Hardware: x86 Linux
: P3 major (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-12 20:43 UTC by Adam Banko
Modified: 2008-02-04 14:46 UTC (History)
0 users

See Also:


Attachments
Force user-write on files before deltion. (1.01 KB, patch)
2008-01-19 11:45 UTC, Wayne Davison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Banko 2008-01-12 20:43:49 UTC
The command: rsync -va --delete-after --delete-excluded -F --password-file=... --chmod=u=rX,g=rwX,o-rwx /home/cassus/ rsync://cassusbackup@kitty/cassusbackup/

The structure on the server is: .../0/qwe/ewq
dr-xrwx--- 163 cassus backup 12288 2008-01-13 03:37 0
-r--rw---- 1 cassus backup 0 2008-01-13 03:20 ewq
dr-xrwx---  2 cassus backup 4096 2008-01-13 03:20 qwe

the "0" folder is the module root.

interesting part of output:
rsync: delete_file: unlink "/qwe/ewq" (in cassusbackup) failed: Permission denied (13)
...
rsync error: some files could not be transferred (code 23) at main.c(977) [sender=2.6.9]

So rsyncd couldn't delete the ewq file from the qwe dir. However, putting new files into that directory works flawlessly. Also if only the ewq file was deleted, so the qwe dir is not to be deleted by the sync, all works. The problem onnly occures when rsync needs to delete a whole hierarchy.
Comment 1 Wayne Davison 2008-01-19 11:45:52 UTC
Created attachment 3115 [details]
Force user-write on files before deltion.

Here's one way to fix the problem.  Am considering if I think this needs further refinement.
Comment 2 Wayne Davison 2008-02-04 14:46:16 UTC
The latest dev source has an optimized version of the proposed patch, which fixes this problem.