Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid trying to set permissions on the cache directory on windows #18867

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -259,9 +260,13 @@ private static VertxOptions convertToVertxOptions(VertxConfiguration conf, Vertx
if (!tmp.mkdirs()) {
LOGGER.warnf("Unable to create Vert.x cache directory : %s", tmp.getAbsolutePath());
}
if (!(tmp.setReadable(true, false) && tmp.setWritable(true, false))) {
LOGGER.warnf("Unable to make the Vert.x cache directory (%s) world readable and writable",
tmp.getAbsolutePath());
String os = System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
if (!os.contains("windows")) {
// Do not execute the following on windows.
if (!(tmp.setReadable(true, false) && tmp.setWritable(true, false))) {
LOGGER.warnf("Unable to make the Vert.x cache directory (%s) world readable and writable",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated question but why are we trying to make it world writable? Shouldn't it be only writable by the current user? Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a structure. The first level is world writable as multiple Quarkus app started by multiple users will write into it. The nested level is limited to the user.

tmp.getAbsolutePath());
}
}
}

Expand Down