You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/02/23 00:42:50 UTC

svn commit: r1292586 - in /commons/proper/compress/trunk/src: changes/changes.xml main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java

Author: sebb
Date: Wed Feb 22 23:42:49 2012
New Revision: 1292586

URL: http://svn.apache.org/viewvc?rev=1292586&view=rev
Log:
COMPRESS-175 - GNU Tar sometimes uses binary encoding for UID and GID

Modified:
    commons/proper/compress/trunk/src/changes/changes.xml
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java

Modified: commons/proper/compress/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/changes/changes.xml?rev=1292586&r1=1292585&r2=1292586&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/changes/changes.xml (original)
+++ commons/proper/compress/trunk/src/changes/changes.xml Wed Feb 22 23:42:49 2012
@@ -46,6 +46,9 @@ The <action> type attribute can be add,u
   <body>
     <release version="1.4" date="unreleased"
              description="Release 1.4">
+      <action issue="COMPRESS-175" type="fix" date="2012-02-22">
+        GNU Tar sometimes uses binary encoding for UID and GID
+      </action> 
       <action issue="COMPRESS-171" type="fix" date="2012-01-29">
         ArchiveStreamFactory.createArchiveInputStream would claim
         short text files were TAR archives.

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=1292586&r1=1292585&r2=1292586&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java Wed Feb 22 23:42:49 2012
@@ -803,9 +803,9 @@ public class TarArchiveEntry implements 
         offset += NAMELEN;
         mode = (int) TarUtils.parseOctal(header, offset, MODELEN);
         offset += MODELEN;
-        userId = (int) TarUtils.parseOctal(header, offset, UIDLEN);
+        userId = (int) TarUtils.parseOctalOrBinary(header, offset, UIDLEN);
         offset += UIDLEN;
-        groupId = (int) TarUtils.parseOctal(header, offset, GIDLEN);
+        groupId = (int) TarUtils.parseOctalOrBinary(header, offset, GIDLEN);
         offset += GIDLEN;
         size = TarUtils.parseOctalOrBinary(header, offset, SIZELEN);
         offset += SIZELEN;