[ python-Bugs-1609958 ] tarfile archive paths limited to less than 100 chars

SourceForge.net noreply at sourceforge.net
Wed Dec 6 23:22:14 CET 2006


Bugs item #1609958, was opened at 2006-12-06 09:58
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1609958&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: Python Library
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Frank Rehberger (frehberg)
Assigned to: Nobody/Anonymous (nobody)
Summary: tarfile archive paths limited to less than 100 chars

Initial Comment:
The tarfile-module 0.8 shipped with Python-2.5 fails to handle archive-paths longer than 100 chars, in posix mode and GNU-mode.

AFAICS, the  path-length limit should be 256 for posix-mode and infinite for GNU-mode.

The last tarfile module I know, being able to handle long paths is tarfile-0.7.4.

Attached you will find a test-script. The script prints the tarfile.version you are using to console and runs two tests, one for posix-mode up to path-length 256 and a second test for GNU-mode with pathlengths up to 1024.

###
###Testoutput with Python-2.5
###
> /usr/local/bin/python2.5 check-tarfile-module.py
Python Version: 2.5 (r25:51908, Dec  6 2006, 10:13:25)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-47)]
Executable: /home/frehberg/tmp/bin/python
Tarfile Version:  0.8.0
TarFile pathlength check failed, do not use!!
failed for tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/fooo (length 100, posix=True)
TarFile pathlength check failed, do not use!!
failed for tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/fooo (length 100, posix=False)

###
###Workarround for Python-2.5
###
(Assuming you are using Linux and Python-2.5 has been installed with prefix /usr/local/)

Download tarfile-0.7.4 from http://www.gustaebel.de/lars/tarfile/ and run:

## remove original tarfile-module shipped with
## python2.5
rm -rf /usr/local/lib/python2.5/tarfile.py*

## install tarfile-0.7.4
tar -xvz -C /tmp/ -f /net/linux/pkg/python/tarfile-0.7.4.tar.gz
cd /tmp/tarfile-0.7.4/
/usr/local/bin/python2.5 setup.py install

###
###Testoutput with patched Python-2.5
###
> /usr/local/bin/python2.5 check-tarfile-module.py
Python Version: 2.5 (r25:51908, Dec  6 2006, 10:13:25)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-47)]
Executable: /usr/local/bin/python
Tarfile Version:  0.7.4
Tarfile module (posix=True) is Ok
Tarfile module (posix=False) is Ok


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

>Comment By: Georg Brandl (gbrandl)
Date: 2006-12-06 22:22

Message:
Logged In: YES 
user_id=849994
Originator: NO

This was fixed by patch #1610437, thanks for the report.

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

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


More information about the Python-bugs-list mailing list