AtharvUrunkar commented on code in PR #39363:
URL: https://github.com/apache/beam/pull/39363#discussion_r3627902655
##########
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/artifact/ArtifactStagingService.java:
##########
@@ -510,8 +510,10 @@ private String createFilename(String environment,
RunnerApi.ArtifactInformation
// all path separators.
List<String> components =
Splitter.onPattern("[^A-Za-z-_.]]").splitToList(path);
String base = components.get(components.size() - 1);
+ String sanitizedEnvironment =
environment.replaceAll("[<>:\"/\\\\|?*]", "_");
Review Comment:
Thanks for tracing this. Good catch on the splitter pattern and `base`
potentially carrying invalid filename characters as well.
I agree that an ASCII-only allowlist would be unnecessarily restrictive for
valid Unicode filenames. I'll update the fix to preserve Unicode while
sanitizing Windows-invalid characters, and I'll also take another look at the
splitter issue so that both the environment-derived and artifact-derived parts
of the generated filename are safe.
I'll add/update the regression tests accordingly.
--
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]