COMPRESS-175 - GNU Tar sometimes uses binary encoding for UID and GID
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/compress/trunk@1292586 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 206d644..f29ce0b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -46,6 +46,9 @@
<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.
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
index 69a00eb..a5b037e 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
@@ -803,9 +803,9 @@
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;