Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 34738 invoked from network); 20 Jan 2001 20:53:30 -0000 Received: from unknown (HELO mail.epost.de) (64.39.38.71) by h31.sny.collab.net with SMTP; 20 Jan 2001 20:53:30 -0000 Received: from nshome (62.226.231.21) by mail.epost.de (5.1.057) id 3A632A310005C2E5 for ant-dev@jakarta.apache.org; Sat, 20 Jan 2001 21:53:14 +0100 Message-ID: <025f01c08323$1bb1b920$0100280a@nshome> From: "Nico Seessle" To: Subject: [Bug 647] - tar corrupting file name Date: Sat, 20 Jan 2001 21:53:55 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_025B_01C0832B.7C3CDDD0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N ------=_NextPart_000_025B_01C0832B.7C3CDDD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit TarEntry.java was validating the maximum length for filenames only in one place. The tar-task used another constructor. Simply copied the verification to the other constructor to do the check there also. Now throws a RuntimeException. ------=_NextPart_000_025B_01C0832B.7C3CDDD0 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patch.txt" Index: TarEntry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: = /home/cvspublic/jakarta-ant/src/main/org/apache/tools/tar/TarEntry.java,v= retrieving revision 1.2 diff -u -r1.2 TarEntry.java --- TarEntry.java 2001/01/03 14:18:48 1.2 +++ TarEntry.java 2001/01/20 20:52:40 @@ -177,6 +177,12 @@ this.groupName =3D new StringBuffer(""); this.devMajor =3D 0; this.devMinor =3D 0; + + if (this.name.length() > NAMELEN) { + throw new RuntimeException("file name '" + this.name=20 + + "' is too long ( > "=20 + + NAMELEN + " bytes)"); + }=20 } =20 =20 /**=20 ------=_NextPart_000_025B_01C0832B.7C3CDDD0--