Skip to content

fix(desktop): safely retire owned runtime symlinks during cleanup #177

Closed

Description

@ElbertePlinio

Found during #156 real native-app acceptance against PR176 candidate e20c5ab (merged2881c6ed365a1ed388fbf5d92bd328dac039dc16).

LibreOffice Writer26.8.0.3 created ordinary Fontconfig compatibility symlinks in its private HOME cache. After all contained apps, Xvfb and x11vnc had stopped, session_destroy failed because removeOwnedEntry in packages/desktop-linux/src/runtime.ts rejects every symbolic link before checking the leaf entry's ownership. The retained runtime contains UID-owned cache-9/cache-10/cache-11 links to sibling cache-12 files. Parent independently inspected these entries with lstat/readlink and confirmed the recorded process identities are gone. No manual deletion or guard bypass was attempted.

This blocks #156 cleanup acceptance. Repair the overbroad leaf rejection, not ownership/confinement protection.

  • Reproduce the normal owned Fontconfig-style symlink cleanup failure with a focused test.
  • Retire only proven owned leaf entries through the existing held parent directory and identity checks. Never follow a symlink or traverse/remove its target, including outside-target, dangling, directory-target and cyclic links.
  • Preserve refusal for foreign ownership, replaced entries/directories and unsafe root/runtime paths, and preserve shutdown-before-cleanup ordering. Do not add filename allowlists, recursive pathname rm, permission bypasses or new generic filesystem APIs.
  • Run focused lifecycle/ownership/security tests, typecheck/build/lint/full suite/coverage and controller complexity under fresh private environments.
  • Two independent sensitive-area reviews, including a reviewer distinct from the author; exact candidate CI before merge.
  • Re-run real Writer teardown through Astra-low qualification on the repaired artifact, retaining this original failed run and residue until supported cleanup can safely succeed.

Part of #156/#118. Keep private evidence out of GitHub. No release or real-desktop access is authorized by this issue.

Current candidate is PR178/8a8d3ba. Exact-tree CI has ten green checks; full tests and coverage each report 1,943 passed and eight CI skips. The root-replacement finding was repaired with deterministic red/green tests. Supported installed-candidate cleanup retired the original retained Writer runtime and a fresh Writer runtime, including their ordinary Fontconfig symlinks, without manual deletion. Two separate Astra opinions are retained, but the controller requires distinct reviewer models; Fable execution is blocked by exhausted usage credits. Final review and merge remain pending.

2026-09-16 final review update: Fable execution resumed successfully. Distinct Astra/Fable scoped source reviews now pass, all current checks and requirements are satisfied, and the managed repair task is verified. Exact candidate8a8d3ba remains unchanged. PR178 delivery is next; this does not qualify the published package or close #156.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions