fixed chmod bug pointed out by Han Holl <jeholl@euronet.nl>
authorAndrew Tridgell <tridge@samba.org>
Thu, 18 Jun 1998 13:26:10 +0000 (13:26 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 18 Jun 1998 13:26:10 +0000 (13:26 +0000)
rsync.c

diff --git a/rsync.c b/rsync.c
index 8e7b74c92082736f223f08166bc09d8c58737be5..3832145950ca63e5a448c5f55641cb3cf67d62f2 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -311,7 +311,8 @@ static int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
 
 #ifdef HAVE_CHMOD
        if (preserve_perms && !S_ISLNK(st->st_mode) &&
-           st->st_mode != file->mode) {
+           (st->st_mode != file->mode || 
+            (updated && (file->mode & ~ACCESSPERMS)))) {
                updated = 1;
                if (do_chmod(fname,file->mode) != 0) {
                        rprintf(FERROR,"failed to set permissions on %s : %s\n",