trouble with chmod on certain symlinks

John Van Essen vanes002 at umn.edu
Mon Jan 3 06:55:01 GMT 2005


Wayne,

> diff -u -r1.1.1.6 rsync.c
> --- rsync.c     3 Jan 2004 11:22:00 -0000       1.1.1.6
> +++ rsync.c     21 Dec 2004 12:04:56 -0000
> @@ -260,7 +260,7 @@
>                      change to groups that the user is a member of */
>                  change_gid = is_in_group(file->gid);
>          }
> -       if (change_uid || change_gid) {
> +       if (!S_ISLNK(st->st_mode) && (change_uid || change_gid)) {
>                  if (do_lchown(fname,
>                                change_uid?file->uid:st->st_uid,
>                                change_gid?file->gid:st->st_gid) != 0) {

Since the problem is that Darwin has no lchown function implemented,
for portability, this if statement could be:

#ifdef HAVE_LCHOWN
        if (change_uid || change_gid) {
#else
        if (!S_ISLNK(st->st_mode) && (change_uid || change_gid)) {
#endif


    John



More information about the rsync mailing list