diff --git a/OpenICF-java-framework/connector-framework-internal/src/main/java/org/identityconnectors/framework/impl/api/local/LocalConnectorInfoManagerImpl.java b/OpenICF-java-framework/connector-framework-internal/src/main/java/org/identityconnectors/framework/impl/api/local/LocalConnectorInfoManagerImpl.java index 34aa3b37..445606b0 100644 --- a/OpenICF-java-framework/connector-framework-internal/src/main/java/org/identityconnectors/framework/impl/api/local/LocalConnectorInfoManagerImpl.java +++ b/OpenICF-java-framework/connector-framework-internal/src/main/java/org/identityconnectors/framework/impl/api/local/LocalConnectorInfoManagerImpl.java @@ -489,10 +489,16 @@ private File getBundleTempDir() throws IOException { if (!tempDir.exists()) { throw new IOException("Temporary directory " + tempDir + " does not exist"); } + if (!tempDir.canWrite()) { + throw new IOException("Temporary directory " + tempDir + " is read/only"); + } File candidate; do { candidate = new File(tempDir, "bundle-" + nextRandom()); - } while (!candidate.mkdir()); + } while (candidate.exists()); + if (!candidate.mkdir()) { + throw new IOException("Temporary directory " + tempDir + " is read/only"); + } candidate.deleteOnExit(); _bundleTempDir = candidate; return candidate;