--link-dest uid/gid checking bug?

jw schultz jw at pegasys.ws
Thu Mar 27 07:27:39 EST 2003


On Fri, Mar 21, 2003 at 10:46:27AM -0500, Chris Darroch wrote:
>    OK, thanks -- here's the patch I'm using now for my own
> installation.
> 
>    If there's no desire to put it (or a better version of it)
> into CVS, then I'd suggest changing the man page so that the
> behaviour of rsync with --list-dest but without --owner, --group,
> and --perms is documented.  Otherwise it's somewhat counter-intuitive:
> hard links are created, then immediately deleted, and the files
> transferred anyway.

Patch comitted.

> diff -u generator.c.orig generator.c
> ====================================
> --- generator.c.orig	2003-03-19 15:07:29.592476000 -0500
> +++ generator.c	2003-03-20 10:26:04.050060000 -0500
> @@ -52,10 +52,14 @@
>  		return 0;
>  	}
>  	if (link_dest) {
> -		if((st->st_mode & ~_S_IFMT) !=  (file->mode & ~_S_IFMT)) {
> +		extern int preserve_perms;
> +		extern int preserve_uid;
> +		extern int preserve_gid;
> +
> +		if(preserve_perms && ((st->st_mode & ~_S_IFMT) != (file->mode &
> ~_S_IFMT))) {
>  			return 0;
>  		}
> -		if (st->st_uid != file->uid || st->st_gid != file->gid) {
> +		if((preserve_uid && st->st_uid != file->uid) || (preserve_gid &&
> st->st_gid != file->gid)) {
>  			return 0;
>  		}
>  	}

-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt


More information about the rsync mailing list