]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/rsync/0001-Check-fname-in-recv_files-sooner.patch
rsync: add security fix patches
[coffee/buildroot.git] / package / rsync / 0001-Check-fname-in-recv_files-sooner.patch
1 From 3e06d40029cfdce9d0f73d87cfd4edaf54be9c51 Mon Sep 17 00:00:00 2001
2 From: Jeriko One <jeriko.one@gmx.us>
3 Date: Thu, 2 Nov 2017 23:44:19 -0700
4 Subject: [PATCH] Check fname in recv_files sooner.
5
6 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
7 ---
8 Patch status: upstream commit 3e06d40029c
9
10  receiver.c | 12 ++++++------
11  1 file changed, 6 insertions(+), 6 deletions(-)
12
13 diff --git a/receiver.c b/receiver.c
14 index baae3a919cdd..9fdafa152cb3 100644
15 --- a/receiver.c
16 +++ b/receiver.c
17 @@ -574,6 +574,12 @@ int recv_files(int f_in, int f_out, char *local_name)
18                         file = dir_flist->files[cur_flist->parent_ndx];
19                 fname = local_name ? local_name : f_name(file, fbuf);
20  
21 +               if (daemon_filter_list.head
22 +                   && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
23 +                       rprintf(FERROR, "attempt to hack rsync failed.\n");
24 +                       exit_cleanup(RERR_PROTOCOL);
25 +               }
26 +
27                 if (DEBUG_GTE(RECV, 1))
28                         rprintf(FINFO, "recv_files(%s)\n", fname);
29  
30 @@ -645,12 +651,6 @@ int recv_files(int f_in, int f_out, char *local_name)
31  
32                 cleanup_got_literal = 0;
33  
34 -               if (daemon_filter_list.head
35 -                   && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
36 -                       rprintf(FERROR, "attempt to hack rsync failed.\n");
37 -                       exit_cleanup(RERR_PROTOCOL);
38 -               }
39 -
40                 if (read_batch) {
41                         int wanted = redoing
42                                    ? we_want_redo(ndx)
43 -- 
44 2.15.0
45