Skip to content

fix(display): validate Wayland socket paths - #1798

Open
unbridled-41 wants to merge 1 commit into
OpenAtom-Linyaps:masterfrom
unbridled-41:fix/wayland-display-socket-validation
Open

fix(display): validate Wayland socket paths#1798
unbridled-41 wants to merge 1 commit into
OpenAtom-Linyaps:masterfrom
unbridled-41:fix/wayland-display-socket-validation

Conversation

@unbridled-41

Copy link
Copy Markdown

Summary

Reject empty Wayland display names and filesystem paths that do not refer to Unix sockets.

Root cause

getWaylandDisplay() indexed display[0] without checking for an empty string. It also treated any existing path as a valid display socket, so regular files and directories could be returned to callers.

Changes

  • Reject an empty WAYLAND_DISPLAY value before indexing it.
  • Inspect the resolved path with std::filesystem::status().
  • Require the path type to be a Unix socket.
  • Add tests for empty input, regular files, directories, and real absolute/relative sockets.

Test plan

  • Release build with the complete fix set
  • Full CTest suite: 528 passed, 2 unrelated environment-dependent X11 tests skipped, 0 failed
  • Added four focused Wayland validation 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.

Reject an empty WAYLAND_DISPLAY before indexing it and require resolved display paths to be Unix sockets rather than merely existing filesystem entries. Add coverage for empty input, files, directories, and real sockets.

Signed-off-by: 做着百万梦的鱼 <yangzihao_41@outlook.com>
@unbridled-41
unbridled-41 force-pushed the fix/wayland-display-socket-validation branch from 3cb9250 to 4e6f23f 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