andyhuangdev opened a new pull request, #11813: URL: https://github.com/apache/ozone/pull/11813
## What changes were proposed in this pull request? CreateDirectory and CreateFile do not normalize key names before creating FSO entries. Paths containing . or .. can therefore create literal directory entries that subsequent operations normalize away, leaving entries difficult to address and causing file commit failures. This patch normalizes key names in both requests before checking the snapshot reserved name and writes the normalized names into the request passed to Raft. CreateFile reuses validateAndNormalizeKey. CreateDirectory normalizes paths and rejects remaining .. components while preserving supported directory name characters such as :. Normalization follows the bucket layout: always for FSO, only when filesystem paths are enabled for LEGACY, and never for OBS. Existing abnormal entries are not cleaned up. ## What is the link to the Apache JIRA [HDDS-16774](https://issues.apache.org/jira/browse/HDDS-16774) ## How was this patch tested? Regression tests cover path normalization, paths above the bucket root, paths resolving to the bucket root, snapshot reserved names, and directory names containing :. Before the fix, 17 regression cases failed. The directory/file create and key create/commit test suites completed with 352 tests passed, 1 skipped, and no failures: mvn -pl :ozone-manager test \ '-Dtest=TestOMDirectoryCreateRequest*,TestOMFileCreateRequest*,TestOMKeyCreateRequest*,TestOMKeyCommitRequest*' \ -DskipShade -DskipRecon -DskipDocs Checkstyle and git diff --check also passed. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
