bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Bug report: tar-1.24 creates empty directories in the current


From: Volker Schmidt
Subject: [Bug-tar] Bug report: tar-1.24 creates empty directories in the current working directory due to a bug in the new openat() code
Date: Tue, 2 Nov 2010 17:59:04 +0100 (CET)

Dear All,

There is a bug in tar-1.24 which causes tar to create empty directories in the 
current working directory when it is not supposed to do that. Here is how to 
recreate the bug:

$ mkdir destination
$ tar -C destination -xf tar-1.24.tar.bz2

When you run the preceding commands, tar unpacks the file tar-1.24.tar.bz2 in 
the directory "destination" as expected, but it also creates the empty 
directory tree "tar-1.24" in the current working directory. The below patch 
seems to fix that.

diff -urN tar-1.24.orig/src/extract.c tar-1.24/src/extract.c
--- tar-1.24.orig/src/extract.c 2010-10-24 20:07:54.000000000 +0200
+++ tar-1.24/src/extract.c      2010-11-02 17:16:00.000000000 +0100
@@ -777,7 +777,7 @@
 
   for (;;)
     {
-      status = mkdir (file_name, mode);
+      status = mkdirat (chdir_fd, file_name, mode);
       if (status == 0)
        {
          current_mode = mode & ~ current_umask;

Please do not hesitate to contact me if you have any questions.

Best regards,

Volker Schmidt
___________________________________________________________
WEB.DE DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://produkte.web.de/go/DSL_Doppel_Flatrate/2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]