Check fname in recv_files sooner.
authorJeriko One <jeriko.one@gmx.us>
Fri, 3 Nov 2017 06:44:19 +0000 (23:44 -0700)
committerWayne Davison <wayned@samba.org>
Mon, 4 Dec 2017 00:12:28 +0000 (16:12 -0800)
receiver.c

index baae3a919cdd5db81afdb6c6bacd22081ff098e5..9fdafa152cb38d0fa8191b14af5cfc49a06a185c 100644 (file)
@@ -574,6 +574,12 @@ int recv_files(int f_in, int f_out, char *local_name)
                        file = dir_flist->files[cur_flist->parent_ndx];
                fname = local_name ? local_name : f_name(file, fbuf);
 
+               if (daemon_filter_list.head
+                   && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
+                       rprintf(FERROR, "attempt to hack rsync failed.\n");
+                       exit_cleanup(RERR_PROTOCOL);
+               }
+
                if (DEBUG_GTE(RECV, 1))
                        rprintf(FINFO, "recv_files(%s)\n", fname);
 
@@ -645,12 +651,6 @@ int recv_files(int f_in, int f_out, char *local_name)
 
                cleanup_got_literal = 0;
 
-               if (daemon_filter_list.head
-                   && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
-                       rprintf(FERROR, "attempt to hack rsync failed.\n");
-                       exit_cleanup(RERR_PROTOCOL);
-               }
-
                if (read_batch) {
                        int wanted = redoing
                                   ? we_want_redo(ndx)