]> git.cworth.org Git - tar/commitdiff
upstream: Fix extraction of device nodes. master
authorSergey Poznyakoff <gray@gnu.org.ua>
Mon, 1 Nov 2010 13:04:41 +0000 (15:04 +0200)
committerCarl Worth <cworth@cworth.org>
Sat, 6 Nov 2010 19:52:56 +0000 (12:52 -0700)
Cherry-picked from upstream commit
3913675640f65bb4774429d369681957b528996e:

* src/extract.c (extract_node): Do not mask out node type.
The bug was introduced in commit ea964cce.

debian/changelog
src/extract.c

index c6250bd88477735b0d84534b9da59cac7cc7eccd..19fa7780c764e0824ff5095639a35341fcb2703b 100644 (file)
@@ -1,9 +1,10 @@
 tar (1.24-2) unstable; urgency=low
 
-  * upstream patch to fix extraction of of empty directories with -C,
+  * upstream patch to fix extraction of empty directories with -C,
     closes: #602209.
+  * upstream patch to fix extraction of device nodes, closes: #602184.
 
- -- Carl Worth <cworth@cworth.org>  Sat, 06 Nov 2010 12:51:16 -0700
+ -- Carl Worth <cworth@cworth.org>  Sat, 06 Nov 2010 12:52:50 -0700
 
 tar (1.24-1) unstable; urgency=low
 
index 98236acad29b03260f9df7466edc25dc1d8cc13f..3d3eafbcc6b9b9d30cc99796f5f994a98779b8d8 100644 (file)
@@ -1191,7 +1191,7 @@ static int
 extract_node (char *file_name, int typeflag)
 {
   bool interdir_made = false;
-  mode_t mode = (current_stat_info.stat.st_mode & MODE_RWX
+  mode_t mode = (current_stat_info.stat.st_mode & (MODE_RWX | S_IFBLK | S_IFCHR)
                 & ~ (0 < same_owner_option ? S_IRWXG | S_IRWXO : 0));
 
   while (mknodat (chdir_fd, file_name, mode, current_stat_info.stat.st_rdev)