make rsync behave more like GNU cp with regard to file permissions
[rsync/rsync.git] / rsync.c
diff --git a/rsync.c b/rsync.c
index 0ed4a58..5ce968c 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -855,7 +855,7 @@ static void finish_transfer(char *fname, char *fnametmp, struct file_struct *fil
                if (errno == EXDEV) {
                        /* rename failed on cross-filesystem link.  
                           Copy the file instead. */
-                       if (copy_file(fnametmp,fname, file->mode)) {
+                       if (copy_file(fnametmp,fname, file->mode & ACCESSPERMS)) {
                                rprintf(FERROR,"copy %s -> %s : %s\n",
                                        fnametmp,fname,strerror(errno));
                        } else {