Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-336

Extended Standard TAR format prefix is 130 characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.10
    • 1.11
    • Archivers
    • None

    Description

      A TAR archive created with star having an artype of "xstar" apparently limits the PREFIX to 130 characters to accommodate an access time and a creation time (this much I was able to learn from the star man page). I wasn't able to track down any specifics about the format, but in at least the first example I found, it appears that the access and creation time are stored as two space terminated ASCII numbers at the end of what would otherwise be the prefix.

      Currently, the code will read this type of archive and assume the prefix is 131 NULs followed by the two ASCII time stamps. Needless to say, it makes a mess of the entry names.

      I'm not 100% sure of the implementation, but perhaps something like (with XSTAR_PREFIXLEN == 130):

      default: {
        final int prefixlen = header[offset + XSTAR_PREFIXLEN + 1] == 0 ? XSTAR_PREFIXLEN : PREFIXLEN;
        String prefix = oldStyle
          ? TarUtils.parseName(header, offset, prefixlen)
          : TarUtils.parseName(header, offset, prefixlen, encoding);
        // ...
      }
      

      Maybe a separate feature request would be appropriate for capturing and exposing the additional timestamps?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jgustie Jeremy Gustie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: