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

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

I've changed the default header values to zero:

URL: http://svn.apache.org/viewvc?rev=758837&view=rev
Log:
The default value for fileFormat must be chosen so checkNewFormat() and 
checkOldFormat() both fail; -1 is not suitable.
Initialise other fields to zero as that is what the trailer needs.
Update Javadoc

The output stream no longer needs to set the mode:
URL: http://svn.apache.org/viewvc?rev=758838&view=rev
Log:
Mode defaults to zero, so no need to set 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.

Reply via email to