Repository navigation
Reject malformed ORC timezone data and unsafe timezone names (2.1.2) - #38
Merged
Merged
Conversation
Port of #35 to `ClickHouse/2.1.2`, used by ClickHouse 25.12. The TZif parser guards apply unchanged. The timezone-name check is adapted to the 2.1.2 `getTimezoneByName`, which has no `TZ_ALIASES` branch. The regression tests come along, except the `US/Pacific` assertion, which needs the alias map from 2.3. CI is enabled for PRs targeting `ClickHouse/2.1.2`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Port of #35 to
ClickHouse/2.1.2, the ORC branch used by ClickHouse 25.12.TimezoneError.hasSafeTimezoneNamePathSyntax, plus the emptyTZDIRcase) is adapted by hand to the 2.1.2getTimezoneByName, which builds the path directly and has noTZ_ALIASESbranch. An unsafe name returns the lazy invalid timezone, as in Reject malformed ORC timezone data and unsafe metadata paths #35.US/Pacificassertion: 2.1.2 has no alias map, so it would depend on the host tzdata shipping thebackwardlinks.build_and_test.ymlalso runs for PRs targetingClickHouse/2.1.2.Why are the changes needed?
ClickHouse 25.12 passes
output_format_orc_writer_time_zone_nameandinput_format_orc_reader_time_zone_nameto ORC unvalidated, and the 2.1.2 TZif parser has the same unchecked accesses that #35 fixed onClickHouse/2.3.1. Of the 8Timezone.cchunks in that PR, 7 apply here as they are.Related: ClickHouse/ClickHouse#125651
How was this patch tested?
TestTimezone.ccandTimezone.ccwere built locally against googletest 1.15.2. With the patch, 18 of 19 tests pass. The one failure,testTzdbFromCondaEnv, also fails on the unpatched branch in that environment. With the oldTimezone.cc, the new tests fail starting attestEmptyTimezoneBuffer. The full ORC CI runs on this PR.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5