An earlier uninstall cleanup failure can be reported as success

Open
#271 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
macos, swift
Domain
desktop, security

Research direction

Start with the privileged script construction and error handling in Sources/GUI/App/PrivilegedUninstall.swift:36-50 and :76-90, then trace how its result reaches Sources/GUI/Views/UninstallView.swift:82-99. Check how each required cleanup command's failure is captured and how the UI reports it before moving the app to Trash. Done means a failed pf or data cleanup step returns a visible failure and identifies the step; the issue notes this has not been reproduced on a signed build.

Written by the indexing model from the issue text.

Description

area:gui bug priority:medium status:queued type:correctness

Both privileged uninstall scripts separate required commands with semicolons, including '/sbin/pfctl -a puresnitch -F all;' and '/sbin/pfctl -a puresnitch -f /dev/null;'. In removeDatabase mode, the Insights-directory deletion is also followed by a database deletion, so an earlier failure can be hidden by a successful final command. PrivilegedUninstall.run then sees no AppleScript error, and UninstallFlowModel moves the app to Trash and displays completion.

Steps

  1. Start uninstall and authorize it.
  2. A required pf flush or earlier data-removal command fails, while the final database-removal command succeeds.
  3. Because the script continues and ends successfully, run returns success.
  4. The app is removed and the user sees uninstall complete even though firewall rules or requested data may remain.

Where

  • Sources/GUI/App/PrivilegedUninstall.swift:36-50
  • Sources/GUI/App/PrivilegedUninstall.swift:76-90
  • Sources/GUI/Views/UninstallView.swift:82-99

Done when: Any failed required pf or data cleanup operation makes the privileged action return a failure, keeps the uninstall result visibly incomplete, and identifies the failed step before the app is moved to Trash.

Related: #211

I found this reading the code and haven't reproduced it on a signed build yet.

Dominant language
Swift
Stars
49
Forks
5
Avg merge
16h 48m
Merged PRs (30d)
82

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from isaaclins/freesnitch

All issues in isaaclins/freesnitch

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.