rem: if (copy_file(fnametmp,fname, file->mode)) {
add: if (copy_file(fnametmp,fname, file->mode & ACCESSPERMS)) {
context: static void finish_transfer(char *fname, char *fnametmp, struct file_struct *file){	if (make_backups) {		char fnamebak[MAXPATHLEN];		if (strlen(fname) + strlen(backup_suffix) > (MAXPATHLEN-1)) {			rprintf(FERROR,"backup filename too long\n");			return;		}		slprintf(fnamebak,sizeof(fnamebak)-1,"%s%s",fname,backup_suffix);		if (do_rename(fname,fnamebak) != 0 && errno != ENOENT) {			rprintf(FERROR,"rename %s %s : %s\n",fname,fnamebak,strerror(errno));			return;		}	}	/* move tmp file over real file */	if (do_rename(fnametmp,fname) != 0) {		if (errno == EXDEV) {			/* rename failed on cross-filesystem link.  			   Copy the file instead. */			if (copy_file(fnametmp,fname, file->mode)) {				rprintf(FERROR,"copy %s -> %s : %s\n",					fnametmp,fname,strerror(errno));			} else {				set_perms(fname,file,NULL,0);			}			do_unlink(fnametmp);		} else {			rprintf(FERROR,"rename %s -> %s : %s\n",				fnametmp,fname,strerror(errno));			do_unlink(fnametmp);		}	} else {		set_perms(fname,file,NULL,0);	}}