Directory ApacheDS
  1. Directory ApacheDS
  2. DIRSERVER-1882

KertabEncoder.write() method should take into account the size of the entries list to determine the buffer size

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M14
    • Fix Version/s: 2.0.0-M15
    • Component/s: core
    • Labels:
      None

      Description

      Currently KeytabEncoder.write() always allocate 512 bytes as the buffer size, and doesn't consider the entities list size.

      ByteBuffer write( byte[] keytabVersion, List<KeytabEntry> entries )
      {
        ByteBuffer buffer = ByteBuffer.allocate( 512 );
        putKeytabVersion( buffer, keytabVersion );
        putKeytabEntries( buffer, entries );
        buffer.flip();
      
        return buffer;
      }
      

      For each entity, KeytabEncoder.putKeytabEntry() allocates 100 buffer size.

      private ByteBuffer putKeytabEntry( KeytabEntry entry )
      {
        ByteBuffer buffer = ByteBuffer.allocate( 100 );
        ......
      }
      

      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.

        Issue Links

          Activity

          Emmanuel Lecharny made changes -
          Fix Version/s 2.0.0-M15 [ 12324890 ]
          Fix Version/s 2.0.0-RC1 [ 12313387 ]
          Emmanuel Lecharny made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.0.0-RC1 [ 12313387 ]
          Resolution Fixed [ 1 ]
          Wei Yan made changes -
          Field Original Value New Value
          Link This issue blocks HADOOP-9860 [ HADOOP-9860 ]
          Wei Yan created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Wei Yan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development