Bug 6936 - rsync silently fails to preserve uid/gid of -1
Summary: rsync silently fails to preserve uid/gid of -1
Status: RESOLVED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.0
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-27 15:35 UTC by Matt McCutchen
Modified: 2011-02-22 12:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt McCutchen 2009-11-27 15:35:53 UTC
Apparently cygwin "stat" can sometimes return a uid or gid of -1.  Since the "chown" syscall takes -1 to mean "don't change this field", rsync silently fails to preserve the source ownership.  This problem came up on the rsnapshot list:

https://sourceforge.net/mailarchive/forum.php?thread_name=1259202707.2009.382.camel%40mattlaptop2.local&forum_name=rsnapshot-discuss

Rsync should issue an FERROR_XFER in this case.  I was inclined to have the receiving side do it because the limitation is in the receiving side's chown call, but it also looks like -1 has a special meaning to the uid-mapping code, so maybe the sender needs to catch the value before it causes trouble there.
Comment 1 Wayne Davison 2011-02-22 12:53:40 UTC
This is now fixed in the git repo.