From owner-freebsd-current Tue Jun 11 16:50:26 2002 Delivered-To: freebsd-current@freebsd.org Received: from smtp.noos.fr (verlaine.noos.net [212.198.2.73]) by hub.freebsd.org (Postfix) with ESMTP id DE24C37B41E for ; Tue, 11 Jun 2002 16:50:00 -0700 (PDT) Received: (qmail 17251555 invoked by uid 0); 11 Jun 2002 23:49:58 -0000 Received: from unknown (HELO gits.gits.dyndns.org) ([212.198.230.194]) (envelope-sender ) by 212.198.2.73 (qmail-ldap-1.03) with SMTP for ; 11 Jun 2002 23:49:58 -0000 Received: from gits.gits.dyndns.org (7x8vbgdjdck4zd4k@localhost [127.0.0.1]) by gits.gits.dyndns.org (8.12.3/8.12.3) with ESMTP id g5BNnva6044255; Wed, 12 Jun 2002 01:49:58 +0200 (CEST) (envelope-from root@gits.dyndns.org) Received: (from root@localhost) by gits.gits.dyndns.org (8.12.3/8.12.3/Submit) id g5BNnu6I044254; Wed, 12 Jun 2002 01:49:56 +0200 (CEST) (envelope-from root) Message-Id: <200206112349.g5BNnu6I044254@gits.gits.dyndns.org> Subject: pax fix (was Re: WARNING! New GNU Tar in 5-CURRENT could erroneously create world writeable dirs) In-Reply-To: <20020607112731.GB28015@gits.dyndns.org> To: freebsd stable , freebsd current Date: Wed, 12 Jun 2002 01:49:56 +0200 (CEST) From: Cyrille Lefevre Cc: Trevor Johnson , Dan Nelson , Maxim Sobolev Reply-To: cyrille.lefevre@laposte.net X-Face: V|+c;4!|B?E%BE^{E6);aI.[< List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Jun 7, 2002 01:27:31 pm +0200, Cyrille Lefevre wrote: > On Fri, Jun 07, 2002 at 02:15:09AM -0400, Trevor Johnson wrote: > > Dan Nelson wrote: > [snip] > > According to Mr. Schilling's testing, GNU tar 1.13.25 has a bug: > > ftp://ftp.fokus.gmd.de/pub/unix/star/testscripts/README.gtarfail . I guess > > it qualifies as a "non-trivial program". :-) > > FYI, the current pax implementation is able to handle the following > archives from ftp://ftp.fokus.gmd.de/pub/unix/star/testscripts/ : > > 100char_longlink.tar > gtarfail.tar > gtarfail2.tar > > but miserably fail on this one : > > long.ustar.gz > > $ uname -a > FreeBSD gits 4.6-RC FreeBSD 4.6-RC #7: Sun Jun 2 16:33:05 CEST 2002 root@gits:/disk2/4.x-stable/src/sys/compile/CUSTOM i386 > $ pax -zvf > -rw-r--r-- 1 486 cvs 4 Apr 19 2000 ___________________ > ___________________________________________________________________________D_099 > /_______________________________________________________________________________ > __________________1000000644 0000746 0003720 00000000004 07077317140 0055507 0 > > $ star -zvtf > 4 -rw-r--r-- jes/cats Apr 19 13:54 2000 __________________________________ > ____________________________________________________________D_099/______________ > ________________________________________________________________________________ > ___100 > > I'll try to fix this... done, here is the patch which may be integrated to 4.6 -release ? Index: /tmp/src/bin/pax/tar.c =================================================================== RCS file: /home/ncvs/src/bin/pax/tar.c,v retrieving revision 1.19 diff -u -r1.19 tar.c --- /tmp/src/bin/pax/tar.c 16 May 2002 01:57:13 -0000 1.19 +++ /tmp/src/bin/pax/tar.c 11 Jun 2002 23:39:16 -0000 @@ -758,7 +758,7 @@ *dest++ = '/'; cnt++; } - arcn->nlen = cnt + l_strncpy(dest, hd->name, sizeof(arcn->name) - cnt); + arcn->nlen = cnt + l_strncpy(dest, hd->name, MIN(TNMSZ + 1, sizeof(arcn->name) - cnt) - 1); arcn->name[arcn->nlen] = '\0'; /* PS : I've finished to merge diffs from OpenBSD last week, but diffs w/ NetBSD are really big... so, be patient :P Cyrille. -- Cyrille Lefevre mailto:cyrille.lefevre@laposte.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message