Skip to content
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 @@ -1778,7 +1778,7 @@ private static void deprecatedSanitizeJVMEnvironment(Map<String, String> environ
}

private static void sanitizeJVMEnvironment(Map<String, String> environment, Map<String, String> imageBuilderEnvironment) {
Set<String> requiredKeys = new HashSet<>(List.of("PATH", "PWD", "HOME", "LANG", "LC_ALL"));
Set<String> requiredKeys = new HashSet<>(List.of("PATH", "PWD", "HOME", "LANG", "LANGUAGE"));
Function<String, String> keyMapper;
if (OS.WINDOWS.isCurrent()) {
requiredKeys.addAll(List.of("TEMP", "INCLUDE", "LIB"));
Expand All @@ -1788,7 +1788,9 @@ private static void sanitizeJVMEnvironment(Map<String, String> environment, Map<
}
Map<String, String> restrictedEnvironment = new HashMap<>();
environment.forEach((key, val) -> {
if (requiredKeys.contains(keyMapper.apply(key))) {
String mappedKey = keyMapper.apply(key);
// LC_* are locale vars that override LANG for specific categories (or all, with LC_ALL)
if (requiredKeys.contains(mappedKey) || mappedKey.startsWith("LC_")) {
restrictedEnvironment.put(key, val);
}
});
Expand Down