Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-745

Bundle installation fails if manifest is larger than 2K bytes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • JCR Installer 3.0.0
    • JCR Installer 3.0.0
    • Installer
    • None

    Description

      Currently the BundleResourceProcessor marks the bundle input stream for 2048 bytes of read-head to read the MANIFEST.MF file. Unfortunately, this "limits" supprt for MANIFEST.MF files to 2048 bytes. We have one situation, where the actual MANIFEST.MF file is more than 64'000 bytes. Reading the MANIFEST.MF file succeeds but resetting the input stream fails.

      I propose to modify the BundleResourceProcessor and the FileInstallableData as follows:

      • BundleResourceProcessor.getMatchingBundle gets the InstallableData object and gets the InputStream directly from that one and also closes that "private" stream after reading the MANIFEST.MF file.
      • FileInstallableData is modified to not open the InputStream before hand but to keep the JCR Property and open the stream on demand in the adaptTo method.
      • BundleResourceProcessor.installOrUpdate is modified in the finally close to catch IOException on closing the input stream. In addition the null-check is not required because the data variable will never be null in the finally clause.

      BTW: Opening the InputStream upfront in the FileInstallableData constructor may even leave this input stream open, should that stream not be retrieved to be closed !

      Attachments

        1. SLING-745.patch
          7 kB
          Felix Meschberger

        Activity

          People

            fmeschbe Felix Meschberger
            fmeschbe Felix Meschberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: