From owner-freebsd-bugs Sun Nov 10 19:50:08 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id TAA09447 for bugs-outgoing; Sun, 10 Nov 1996 19:50:08 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id TAA09434; Sun, 10 Nov 1996 19:50:04 -0800 (PST) Resent-Date: Sun, 10 Nov 1996 19:50:04 -0800 (PST) Resent-Message-Id: <199611110350.TAA09434@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, dawes@physics.usyd.edu.au Received: from landfill.physics.usyd.edu.au (landfill.physics.usyd.edu.au [129.78.129.18]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id TAA09046 for ; Sun, 10 Nov 1996 19:41:33 -0800 (PST) Received: (from dawes@localhost) by landfill.physics.usyd.edu.au (8.8.2/8.7.3) id OAA15671; Mon, 11 Nov 1996 14:41:23 +1100 (EST) Message-Id: <199611110341.OAA15671@landfill.physics.usyd.edu.au> Date: Mon, 11 Nov 1996 14:41:23 +1100 (EST) From: David Dawes Reply-To: dawes@physics.usyd.edu.au To: FreeBSD-gnats-submit@freebsd.org Cc: dawes@physics.usyd.edu.au X-Send-Pr-Version: 3.2 Subject: gnu/1992: Gnu tar has problems with hard links to files with long names Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1992 >Category: gnu >Synopsis: Gnu tar has problems with hard links to files with long names >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Nov 10 19:50:02 PST 1996 >Last-Modified: >Originator: David Dawes >Organization: University of Sydney, Australia >Release: FreeBSD 3.0-CURRENT i386 >Environment: >Description: Gnu tar has problems creating an archive which contains a file with a hard link to another file which has a long (>=100 char) name. When listing such an archive, the name of the link is truncated to 99 characters, and when extracting such an archive, an error is reported because it is trying to create a hard link to a file which doesn't exist. >How-To-Repeat: mkdir -p 123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789 mkdir -p 123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/xx echo stuff > 123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/file ln 123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/file 123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/xx/link tar cf test.tar 123456789 Then listing with 'tar vtf test.tar' gives: -rw-r--r-- dawes/theory 0 Nov 11 14:35 1996 123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/file link to 123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789 And attempting to extract gives: tar: Could not link 123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/file to 123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789 : No such file or directory >Fix: The following patch appears to fix the problem, which is seems to be a long-standing problem with gnu tar. I'm planning to send this patch to the maintainer of gnu tar. Index: create.c =================================================================== RCS file: /home/cvs/src/gnu/usr.bin/tar/create.c,v retrieving revision 1.3 diff -c -r1.3 create.c *** create.c 1995/06/26 06:24:37 1.3 --- create.c 1996/11/11 03:22:52 *************** *** 313,319 **** } link_name++; } ! if (link_name - lp->name >= NAMSIZ) write_long (link_name, LF_LONGLINK); current_link_name = link_name; --- 313,319 ---- } link_name++; } ! if (strlen(link_name) >= NAMSIZ) write_long (link_name, LF_LONGLINK); current_link_name = link_name; >Audit-Trail: >Unformatted: