You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
913 B

  1. commit 70aeb5fddd1b2f8e143276f8d5a085db16c593b9
  2. Author: Jeriko One <jeriko.one@gmx.us>
  3. Date: Thu Nov 16 17:05:42 2017 -0800
  4. Sanitize xname in read_ndx_and_attrs.
  5. diff --git a/rsync.c b/rsync.c
  6. index b82e598..a0945ba 100644
  7. --- a/rsync.c
  8. +++ b/rsync.c
  9. @@ -49,6 +49,7 @@ extern int flist_eof;
  10. extern int file_old_total;
  11. extern int keep_dirlinks;
  12. extern int make_backups;
  13. +extern int sanitize_paths;
  14. extern struct file_list *cur_flist, *first_flist, *dir_flist;
  15. extern struct chmod_mode_struct *daemon_chmod_modes;
  16. #ifdef ICONV_OPTION
  17. @@ -396,6 +397,11 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr,
  18. if (iflags & ITEM_XNAME_FOLLOWS) {
  19. if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0)
  20. exit_cleanup(RERR_PROTOCOL);
  21. +
  22. + if (sanitize_paths) {
  23. + sanitize_path(buf, buf, "", 0, SP_DEFAULT);
  24. + len = strlen(buf);
  25. + }
  26. } else {
  27. *buf = '\0';
  28. len = -1;