rsync 2.5.7 link-dest seems broken

jw schultz jw at
Wed Dec 31 09:51:07 EST 2003

On Tue, Dec 30, 2003 at 02:02:16PM -0800, Wayne Davison wrote:
> On Tue, Dec 30, 2003 at 07:34:48PM +0000, gname at wrote:
> > I assumed numeric id's are not used unless explictly asked for.
> As I expected, the code is not dealing with the IDs properly when
> running as a non-root user.  It leaves the UIDs untranslated in the
> internal data structures when non-root, even if a translation is
> available (since it doesn't ever try to change the ownership of the
> files).  It also handles group IDs in such a way that if the GID of
> the source source file is either not available on the destination
> machine or the user doesn't have permissions to use it, then the GID
> in the data structure will also fail to match any destination GID.
> Both of these problems will cause link-dest's check for identical-
> ness to fail.

The question is, should link-dest make the decision based on
the source uid/gid or based on the uid/gid the file winds up
with.  If the uid/gid the file winds up with then we should
abstract the gid logic from set_perms into a seperate
function to use in both, or more places.

> I have a fix that I can commit after 2.6.0 gets released, but I have a
> question about group-setting that goes beyond the --link-dest option:
> What should we do if we're updating an existing file with a group that
> doesn't match, but the group on the source file is not one that the
> current user has permissions to use (or it doesn't exist on the system)?
> One solution would be to leave the group unchanged.  Another solution
> would be to change the group to the user's default group (i.e. use the
> group the file would get if it were being created by the transfer).
> Opinions?  I know which one I prefer, but I'm interested in what others
> think.

If we cannot match the source gid I'm disinclined to behave
differently than file creation semantics.  Unfortunately
directory sgid effect is not consistant.  It depends on the
OS and filesystem mount options.

For non-root, it should be unchanged from the temp-file to
comply with directory sgid.  If it is just an ownership
change (in-place) i'm inclined to leave it unchanged
so a second pass will not change the results of the first
pass.  I think that is what we do now.

	J.W. Schultz            Pegasystems Technologies
	email address:		jw at

		Remember Cernan and Schmitt

More information about the rsync mailing list