Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/pax In GNU-tar mode, don't split filenames to prefix+nam...



details:   https://anonhg.NetBSD.org/src/rev/f61728990b43
branches:  trunk
changeset: 570169:f61728990b43
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Sep 26 22:49:05 2004 +0000

description:
In GNU-tar mode, don't split filenames to prefix+name because GNU tar does
not honor it.

diffstat:

 bin/pax/tar.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 646d4e882be0 -r f61728990b43 bin/pax/tar.c
--- a/bin/pax/tar.c     Sun Sep 26 21:44:26 2004 +0000
+++ b/bin/pax/tar.c     Sun Sep 26 22:49:05 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tar.c,v 1.58 2004/09/22 15:03:18 christos Exp $        */
+/*     $NetBSD: tar.c,v 1.59 2004/09/26 22:49:05 christos Exp $        */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)tar.c      8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: tar.c,v 1.58 2004/09/22 15:03:18 christos Exp $");
+__RCSID("$NetBSD: tar.c,v 1.59 2004/09/26 22:49:05 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1241,7 +1241,15 @@
         */
        if (len < TNMSZ)
                return(name);
-       if (len > (TPFSZ + TNMSZ))
+       /*
+        * GNU tar does not honor the prefix+name mode if the magic
+        * is not "ustar\0". So in GNU tar compatibility mode, we don't
+        * split the filename into prefix+name because we are setting
+        * the magic to "ustar " as GNU tar does. This of course will
+        * end up creating a LongLink record in cases where it does not
+        * really need do, but we are behaving like GNU tar after all.
+        */
+       if (is_gnutar || len > (TPFSZ + TNMSZ))
                return(NULL);
 
        /*



Home | Main Index | Thread Index | Old Index