Skip to content

starboard: Resolve the full /etc/localtime symlink chain for the timezone - #13052

Merged
andrewsavage1 merged 1 commit into
youtube:mainfrom
hferreiro:tz-realpath
Oct 1, 2026
Merged

andrewsavage1 merged 1 commit into
youtube:mainfrom
hferreiro:tz-realpath

Conversation

@hferreiro

Copy link
Copy Markdown
Collaborator

SbTimeZoneGetName uses a single readlink to resolve /etc/localtime. When /etc/localtime is a multi-level symlink (e.g. inside a container where it might point to the host's file) the function fails.

Use realpath to resolve the whole chain.

Bug: 532068409

… zone

`SbTimeZoneGetName` uses a single readlink to resolve /etc/localtime.
When /etc/localtime is a multi-level symlink (e.g. inside a container
where it might point to the host's file) the function fails.

Use `realpath` to resolve the whole chain.

Bug: 532068409
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


starboard: Resolve full timezone symlink chain

Resolve the entire symlink path for the system timezone file in
SbTimeZoneGetName. Using a single readlink fails to resolve multi-level
symlinks, which are common in containerized environments where
/etc/localtime points to the host timezone file via intermediate
links. Resolving the full chain ensures the timezone name can be
correctly extracted from the final path.

Bug: 532068409

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Context State Description
CI / All Pass ✅ PASS All checks passed
CI / android ✅ PASS Passed
CI / evergreen ✅ PASS Passed
CI / linux ✅ PASS Passed
CI / tvos ✅ PASS Passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the timezone resolution logic in SbTimeZoneGetName by replacing readlink with realpath. The reviewer suggested caching the resolved timezone name using a thread-local variable to avoid performing expensive file system queries on every function call.

@andrewsavage1
andrewsavage1 merged commit b9de3f3 into youtube:main Oct 1, 2026
647 of 682 checks passed
@github-actions github-actions Bot added the cp-27.lts Cherry Pick to the 27.lts branch label Oct 1, 2026
@hferreiro
hferreiro deleted the tz-realpath branch October 1, 2026 18:05
@oxve oxve removed the cp-27.lts Cherry Pick to the 27.lts branch label Oct 5, 2026
briantting pushed a commit that referenced this pull request Oct 6, 2026
…link chain for the timezone

Refer to original PR: #13052

`SbTimeZoneGetName` uses a single readlink to resolve /etc/localtime.
When /etc/localtime is a multi-level symlink (e.g. inside a container
where it might point to the host's file) the function fails.

Use `realpath` to resolve the whole chain.

Bug: 532068409

(cherry picked from commit b9de3f3)
briantting pushed a commit that referenced this pull request Oct 16, 2026
…link chain for the timezone

Refer to original PR: #13052

`SbTimeZoneGetName` uses a single readlink to resolve /etc/localtime.
When /etc/localtime is a multi-level symlink (e.g. inside a container
where it might point to the host's file) the function fails.

Use `realpath` to resolve the whole chain.

Bug: 532068409

(cherry picked from commit b9de3f3)
briantting pushed a commit that referenced this pull request Oct 16, 2026
…link chain for the timezone

Refer to original PR: #13052

`SbTimeZoneGetName` uses a single readlink to resolve /etc/localtime.
When /etc/localtime is a multi-level symlink (e.g. inside a container
where it might point to the host's file) the function fails.

Use `realpath` to resolve the whole chain.

Bug: 532068409

(cherry picked from commit b9de3f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants