From 5fb543d5879ec3ad8f3e68a92b1766ece1b8326a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 26 Mar 1998 00:32:51 +0000 Subject: [PATCH] if rsync fails to update the group of a file but nothing else then don't report a problem. On most OSes non-root users can't change the group of a file. --- rsync.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/rsync.c b/rsync.c index 2ef416db..3b4ff1ba 100644 --- a/rsync.c +++ b/rsync.c @@ -302,21 +302,24 @@ static int set_perms(char *fname,struct file_struct *file,struct stat *st, if ((am_root && preserve_uid && st->st_uid != file->uid) || (preserve_gid && st->st_gid != file->gid)) { - updated = 1; - if (do_lchown(fname, - (am_root&&preserve_uid)?file->uid:-1, - preserve_gid?file->gid:-1) != 0) { - if (verbose>1 || preserve_uid) - fprintf(FERROR,"chown %s : %s\n",fname,strerror(errno)); - return updated; - } + if (do_lchown(fname, + (am_root&&preserve_uid)?file->uid:-1, + preserve_gid?file->gid:-1) != 0) { + if (preserve_uid && st->st_uid != file->uid) + updated = 1; + if (verbose>1 || preserve_uid) + fprintf(FERROR,"chown %s : %s\n", + fname,strerror(errno)); + return updated; + } + updated = 1; } if (verbose > 1 && report) { - if (updated) - fprintf(FINFO,"%s\n",fname); - else - fprintf(FINFO,"%s is uptodate\n",fname); + if (updated) + fprintf(FINFO,"%s\n",fname); + else + fprintf(FINFO,"%s is uptodate\n",fname); } return updated; } -- 2.34.1