Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-6352

explicitly set java.io.tmpdir not always respected and tmp dir not under nexus work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6, 2.7, 2.8
    • Fix Version/s: 2.8.1, 3.0.0-m1
    • Component/s: Bootstrap
    • Labels:
      None

      Description

      Nexus intends to only use one tmp directory and by default this should be in sonatype-work/nexus/tmp

      However this is not happening in all cases.

      Nexus does not seem to preset the value of java.io.tmpdir to explicitly under sonatype-work anymore, unless value of java.io.tmpdir is null, which is normally not the case - see here.

      Further, we attempt to read, validate and reset the temporary directory
      TemporaryDirectory

      However resetting the temporary directory in this manner, especially using getPath(), would seem a noop. For example Files.createTempFile(String,String) explicitly states such - and code review shows the value of temp dir to be cached statically anyways.

      ...because further it's value is injected in ApplicationDirectoriesImpl which is depended on by many other code locations.

      Things that have a chance of breaking in current code:

      • only specifying java.io.tmpdir in wrapper.conf
      • only specifying java.io.tmpdir in nexus.properties

      The only sane way to override java.io.tmpdir currently is to specify the same absolute value in both places.

      We should change this such that only one place is needed. We should also fix the various race conditions possible in our code and revisit use of createTempfile where it relies on default temp dir. Lastly enforce the correct default tmp dir location

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              plynch Peter Lynch
              Last Updated By:
              Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title