This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tarfile.py: 100-char filenames are truncated
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, lars.gustaebel
Priority: normal Keywords: patch

Created on 2006-10-24 11:21 by lars.gustaebel, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
100chars.diff lars.gustaebel, 2006-10-24 11:21 fix and testcase
Messages (2)
msg51279 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2006-10-24 11:21
Patch #1484695 applied with rev 45954 introduced an
error in the creation of string header fields. The
stn() function used to zero-pad strings assumes that a
string to be put in an N character field, can be at
most N-1 chars long plus a '\0' char. This is wrong. An
N char field can store a N char string, the '\0' is
left out in this case.
The worst effect of this bug is that filenames that are
exactly 100 chars long will be silently truncated to 99
chars. Python 2.5 and 2.6 are affected.

Attached patch fixes the stn() function and adds a
testcase to test_tarfile.py.
msg51280 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-10-24 16:54
Logged In: YES 
user_id=849994

Applied in rev. 52431, 52432 (2.5).
History
Date User Action Args
2022-04-11 14:56:20adminsetgithub: 44160
2006-10-24 11:21:29lars.gustaebelcreate