You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2013/08/10 07:59:47 UTC

[jira] [Commented] (DIRSERVER-1882) KertabEncoder.write() method should take into account the size of the entries list to determine the buffer size

    [ https://issues.apache.org/jira/browse/DIRSERVER-1882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13735774#comment-13735774 ] 

Emmanuel Lecharny commented on DIRSERVER-1882:
----------------------------------------------

Spot on !

Thanks for the report, working on fixing the bug.
                
> KertabEncoder.write() method should take into account the size of the entries list to determine the buffer size
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1882
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1882
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.0-M14
>            Reporter: Wei Yan
>
> Currently {{KeytabEncoder.write()}} always allocate 512 bytes as the buffer size, and doesn't consider the entities list size.
> {code}
> ByteBuffer write( byte[] keytabVersion, List<KeytabEntry> entries )
> {
>   ByteBuffer buffer = ByteBuffer.allocate( 512 );
>   putKeytabVersion( buffer, keytabVersion );
>   putKeytabEntries( buffer, entries );
>   buffer.flip();
>   return buffer;
> }
> {code}
> For each entity, {{KeytabEncoder.putKeytabEntry()}} allocates 100 buffer size.
> {code}
> private ByteBuffer putKeytabEntry( KeytabEntry entry )
> {
>   ByteBuffer buffer = ByteBuffer.allocate( 100 );
>   ......
> }
> {code}
> This mechanism fails when we create multiple principals in one keytab file. 
> {{KeytabEncoder.write()}} method should take into account the size of entries list to determine the buffer size. And a reasonable max size (100 currently) per entry must be determined.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira