Skip to content

fix(common): ignore relative XDG directory overrides - #1795

Open
unbridled-41 wants to merge 1 commit into
OpenAtom-Linyaps:masterfrom
unbridled-41:fix/xdg-relative-paths
Open

fix(common): ignore relative XDG directory overrides#1795
unbridled-41 wants to merge 1 commit into
OpenAtom-Linyaps:masterfrom
unbridled-41:fix/xdg-relative-paths

Conversation

@unbridled-41

Copy link
Copy Markdown

Summary

Ignore relative values in XDG directory environment variables and use the existing fallback paths.

Root cause

The XDG base directory specification requires these environment variables to contain absolute paths. The current helpers accepted any non-empty value, so relative configuration could make runtime, cache, or config paths depend on the process working directory.

Changes

  • Use XDG_RUNTIME_DIR, XDG_CACHE_HOME, and XDG_CONFIG_HOME only when absolute.
  • Preserve the existing fallback behavior for unset, empty, or relative values.
  • Add regression tests for relative and valid absolute overrides.

Test plan

  • Release test target build
  • Four focused XDGTest regression cases
  • git diff --check

@deepin-ci-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: unbridled-41

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown
Collaborator

Hi @unbridled-41. Thanks for your PR.

I'm waiting for a OpenAtom-Linyaps member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@unbridled-41
unbridled-41 force-pushed the fix/xdg-relative-paths branch from 6216df1 to 92659ee Compare August 10, 2026 10:00
Apply XDG directory environment variables only when they contain absolute paths, as required by the base directory specification. Add coverage for relative overrides and valid absolute values.

Signed-off-by: 做着百万梦的鱼 <yangzihao_41@outlook.com>
@unbridled-41
unbridled-41 force-pushed the fix/xdg-relative-paths branch from 92659ee to ae37a96 Compare August 10, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants