DaanHoogland commented on a change in pull request #5066:
URL: https://github.com/apache/cloudstack/pull/5066#discussion_r662952199
##########
File path: core/src/main/java/com/cloud/storage/JavaStorageLayer.java
##########
@@ -178,18 +183,25 @@ public long getSize(String path) {
}
@Override
- public File createUniqDir() {
+ public File createUniqDir() throws IOException {
String dirName = System.getProperty("java.io.tmpdir");
if (dirName != null) {
File dir = new File(dirName);
if (dir.exists()) {
+ if (isWorldReadable(dir)) {
+ if (dir.getAbsolutePath().equals("/tmp")) {
+ s_logger.warn("The temp dir is /tmp");
Review comment:
and than here of course
```suggestion
s_logger.warn(String.format("The temp dir is %s",
STDTMP);
```
##########
File path: core/src/main/java/com/cloud/storage/JavaStorageLayer.java
##########
@@ -178,18 +183,25 @@ public long getSize(String path) {
}
@Override
- public File createUniqDir() {
+ public File createUniqDir() throws IOException {
String dirName = System.getProperty("java.io.tmpdir");
if (dirName != null) {
File dir = new File(dirName);
if (dir.exists()) {
+ if (isWorldReadable(dir)) {
+ if (dir.getAbsolutePath().equals("/tmp")) {
Review comment:
@lujiefsi I think @GabrielBrascher means that we should add a
```
private static final String STDTMP = "/tmp";
```
and than
```suggestion
if (STDTMP.equals(dir.getAbsolutePath()) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]