extern char *password_file;
extern char curr_dir[MAXPATHLEN];
extern struct file_list *first_flist;
-extern struct filter_list_struct server_filter_list;
+extern struct filter_list_struct daemon_filter_list;
uid_t our_uid;
int local_server = 0;
"sent %s bytes received %s bytes %s bytes/sec\n",
human_num(total_written), human_num(total_read),
human_dnum((total_written + total_read)/(0.5 + (endtime - starttime)), 2));
- rprintf(FINFO, "total size is %s speedup is %.2f%s\n",
- human_num(stats.total_size),
- (double)stats.total_size / (total_written+total_read),
+ rprintf(FINFO, "total size is %s speedup is ",
+ human_num(stats.total_size));
+ /* With --dry-run or with --only-write-batch (unless we're a
+ * client receiver), the byte count doesn't include actual file
+ * data, so the speedup is meaningless and we don't print it. */
+ if (write_batch < 0 ? (!am_server && !am_sender) : !dry_run)
+ rprintf(FINFO, "%.2f",
+ (double)stats.total_size / (total_written+total_read));
+ else
+ rprintf(FINFO, "unknown");
+ rprintf(FINFO, "%s\n",
write_batch < 0 ? " (BATCH ONLY)" : dry_run ? " (DRY RUN)" : "");
}
cmd = rsh_env;
if (!cmd)
cmd = RSYNC_RSH;
- cmd = strdup(cmd);
+ cmd = strdup(cmd); /* MEMORY LEAK */
if (!cmd)
goto oom;
if (!dest_path || list_only)
return NULL;
+ if (daemon_filter_list.head
+ && (check_filter(&daemon_filter_list, dest_path, 0 != 0) < 0
+ || check_filter(&daemon_filter_list, dest_path, 1 != 0) < 0)) {
+ rprintf(FERROR, "skipping daemon-excluded destination \"%s\"\n",
+ dest_path);
+ exit_cleanup(RERR_FILESELECT);
+ }
+
/* See what currently exists at the destination. */
if ((statret = do_stat(dest_path, &st)) == 0) {
/* If the destination is a dir, enter it and use mode 1. */
}
check_alt_basis_dirs();
- if (server_filter_list.head) {
+ if (daemon_filter_list.head) {
char **dir_p;
- struct filter_list_struct *elp = &server_filter_list;
+ struct filter_list_struct *elp = &daemon_filter_list;
for (dir_p = basis_dir; *dir_p; dir_p++) {
char *dir = *dir_p;