Skip to content

fix(desktop): validate group padding before hidden ID masking - #12708

Merged
morluto merged 2 commits into
mainfrom
codex/desktop-group-whitespace
Nov 20, 2026
Merged

morluto merged 2 commits into
mainfrom
codex/desktop-group-whitespace

Conversation

@morluto

@morluto morluto commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Problem

The desktop entry parser trimmed all Unicode whitespace before interpreting group headers. As a result, a higher-priority entry with a nonbreaking space before or after [Desktop Entry] could use Hidden=true to mask a lower-priority valid application ID. GLib rejects those group headers.

Change

The desktop entry scan retains the original header padding and validates it before application-ID lookup accepts a hidden override as a deletion. Existing direct-file and nonhidden discovery still use the tolerant group boundary. A malformed hidden entry returns desktop_entry_invalid with the group line.

This changes validation in the existing local file reader. No input or output schema, target authority, or scope decision changes.

Validation

  • Both nonbreaking-space fixtures returned desktop_entry_not_found on the base. They now report desktop_entry_invalid at line 1. The space/tab-padded control still masks its application ID.
  • 161 focused tests passed across the resolver, desktop entry parser and values, and install export. Eight platform-gated cases skipped. npm run check:fast passed.
  • Installed GLib 2.90.0 agreed on ASCII space/tab and nonbreaking space in passive string probes. Validation did not run a Linux desktop session or launch an application. GLib group reader

Author readiness

Human owner: @morluto

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T02:38:15.749051Z 15400a2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Preserves group-header padding so malformed hidden overrides cannot mask an application ID.

  • Hidden desktop entries with nonbreaking-space headers are refused instead of masking an application ID.

Reviews (1) · Last reviewed commit: "test(desktop): compact group padding ove..." · Reviewed by Greptile

@morluto
morluto merged commit 6cab415 into main Nov 20, 2026
40 checks passed
@morluto
morluto deleted the codex/desktop-group-whitespace branch November 20, 2026 02:44
N0zoM1z0 pushed a commit that referenced this pull request Nov 21, 2026
…13126)

The key reader stripped each line with JavaScript's trimStart(), which also
removes Unicode spaces such as U+00A0 and U+3000. GLib skips only
g_ascii_isspace, so it keeps those bytes inside the key and the record never
matches Name= or Hidden=.

The drift had a safety direction: a line indented with U+00A0 and reading
Hidden=true was accepted as a hidden override by REA but never by the desktop
environment, so findHiddenDesktopEntry() claimed a deletion that GLib would not
honour. #12708 closed this for group headers by validating the captured padding
against GLib's ASCII set; the blank-line, comment and key checks still used the
Unicode-aware trim.

I now strip only [ \t\f\r] before deciding whether a line is blank, a comment
or a key, and hand that same string to the record matcher. ASCII indentation
still parses as before. The inventory test covers the refusal when a hidden
override carries the padding, and the domain tests cover the three Unicode
spaces for keys, blank lines and comments.
@morluto morluto added bug Something isn't working area: runtime Process capture and runtime observation labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant