Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1397

FileSystem provider createContainerInLocation can generate folder with invalid permissions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.1
    • Fix Version/s: None
    • Component/s: jclouds-blobstore
    • Labels:
    • Environment:
      Windows 7 Enterprise SP 1
      Java 1.8.0_131

      Description

      I'm using Spring Boot to wrap calls to the blob store in a microservice.  I ran into a problem on a Windows 7 box I was not expecting: the blob container name was initialized with a directory that had no privileges.  With the following property, we ran into a disparity in how the folders are created:

      jclouds.filesystem.basedir=Z:\blob-store

      We have some code in our microservice to ensure the blob store container exists before we attempt to put any blobs in it.  Our initialization code has the following snippet, which should be enough:

      if (!blobStore.containerExists(blobContainerName)) {
           blobStore.createContainerInLocation(null, blobContainerName);
       }

      The end result was that the parent folder described by jclouds.filesystem.basedir was correct in that the permissions on the folder were the default as if you called File.mkdirs() in a standard Java application (read, update, write, execute for the process's user).  However, the folder with the container name had no permissions (all turned off).

      The symptom we had was an Exception thrown by the Filesystem provider because the blob could not be renamed from the UUID temp file name to the one in provided by the putBlob() call.


      Other pertinent facts:

      • The machine is in an Enterprise environment where there are global policies in place for the network.  This is probably a contributing factor since I did not run into this problem on a Windows 10 Professional box in a more relaxed environment.
      • The workaround was to pre-create the directories with the File.mkdirs() call.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bloritsch Berin Loritsch
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: