[Patches] [ python-Patches-1331635 ] tarfile.py: fix for 1330039

SourceForge.net noreply at sourceforge.net
Thu Oct 20 06:56:42 CEST 2005


Patches item #1331635, was opened at 2005-10-19 05:39
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1331635&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.4
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Lars Gustäbel (gustaebel)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: tarfile.py: fix for 1330039

Initial Comment:
The attached patch fixes bug #1330039. The patch
includes a testcase.

A file is added to an archive as a hardlink if a file
with the same inode number (and device number) was
added before without futher checks. This leads to the
undesired behaviour described in #1330039, i.e. if two
throwaway temporary files are assigned the same inode
number by the filesystem, the second one will be added
as a hardlink to the first, which means that the
content will be lost.

The patched code checks if the file's st_nlink is
greater 1. So only for files that actually have several
links pointing to them hardlinks will be created, which
is what GNU tar does.

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2005-10-19 21:56

Message:
Logged In: YES 
user_id=33168

Thanks Lars.

Checked in as:
 * Lib/tarfile.py 1.34 and 1.21.2.6
 * Lib/test/test_tarfile.py 1.20 and 1.16.2.2

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1331635&group_id=5470


More information about the Patches mailing list