commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COMPRESS-55) CpioArchiveEntry ignores invalid modes
Date Thu, 26 Mar 2009 13:31:02 GMT

    [ https://issues.apache.org/jira/browse/COMPRESS-55?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689474#action_12689474
] 

Sebb commented on COMPRESS-55:
------------------------------

Just tried a test with mode 0 allowed.
One test fails:

Unknown mode (full mode: 4294967295, masked mode: 61440
	at org.apache.commons.compress.archivers.cpio.CpioArchiveEntry.setMode(CpioArchiveEntry.java:605)
	at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream.readNewEntry(CpioArchiveInputStream.java:324)
	at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream.getNextCPIOEntry(CpioArchiveInputStream.java:182)
	at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream.getNextEntry(CpioArchiveInputStream.java:421)
	at org.apache.commons.compress.archivers.CpioTestCase.testCpioUnarchive(CpioTestCase.java:82)

4294967295 = 0xFFFFFFFF
61440 = 0xF000

I think this may be due to problems with EOF handling, because I don't think the test file
has that data in it.

> CpioArchiveEntry ignores invalid modes
> --------------------------------------
>
>                 Key: COMPRESS-55
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-55
>             Project: Commons Compress
>          Issue Type: Bug
>            Reporter: Sebb
>
> CpioArchiveEntry has the following code:
> {code}
>         default:
>             // FIXME: testCpioUnarchive fails if I change the line to
>             // actually throw the excpetion
>             new IllegalArgumentException("Unknown mode (full mode: " + mode
>                     + ", masked mode: " + (mode & S_IFMT));
>         }
> {code}
> As the comment says, rejecting invalid modes causes test failures.
> These appear to be caused by the code
> {bq}        this.cpioEntry.setMode(0);
> in the method CpioArchiveOutputStream.finish()
> Is a mode of 0 allowed? If so, then setMode needs to allow it, otherwise the method call
needs to change to something else.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message