001-CVE-2016-6321.patch 933 B

123456789101112131415161718192021222324252627282930
  1. From 7340f67b9860ea0531c1450e5aa261c50f67165d Mon Sep 17 00:00:00 2001
  2. From: Paul Eggert <eggert@Penguin.CS.UCLA.EDU>
  3. Date: Sat, 29 Oct 2016 21:04:40 -0700
  4. Subject: When extracting, skip ".." members
  5. * src/extract.c (extract_archive): Skip members whose names
  6. contain "..".
  7. --- a/src/extract.c
  8. +++ b/src/extract.c
  9. @@ -1629,12 +1629,20 @@ extract_archive (void)
  10. {
  11. char typeflag;
  12. tar_extractor_t fun;
  13. + bool skip_dotdot_name;
  14. fatal_exit_hook = extract_finish;
  15. set_next_block_after (current_header);
  16. + skip_dotdot_name = (!absolute_names_option
  17. + && contains_dot_dot (current_stat_info.orig_file_name));
  18. + if (skip_dotdot_name)
  19. + ERROR ((0, 0, _("%s: Member name contains '..'"),
  20. + quotearg_colon (current_stat_info.orig_file_name)));
  21. +
  22. if (!current_stat_info.file_name[0]
  23. + || skip_dotdot_name
  24. || (interactive_option
  25. && !confirm ("extract", current_stat_info.file_name)))
  26. {