Introduce velocity.natives-tmpdir property for properly handling noexec /tmp

This commit is contained in:
Andrew Steinborn
2019-11-29 14:26:59 -05:00
parent 2f55912995
commit 75359256b3
2 changed files with 17 additions and 1 deletions

View File

@@ -23,6 +23,12 @@ public class Velocity {
if (System.getProperty("io.netty.allocator.maxOrder") == null) {
System.setProperty("io.netty.allocator.maxOrder", "9");
}
// If Velocity's natives are being extracted to a different temporary directory, make sure the
// Netty natives are extracted there as well
if (System.getProperty("velocity.natives-tmpdir") != null) {
System.setProperty("io.netty.native.workdir", System.getProperty("velocity.natives-tmpdir"));
}
}
/**