1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-23 17:00:08 +00:00

fix: harden cleanup path validation

This commit is contained in:
tw93
2026-01-26 15:43:11 +08:00
parent 43a92a1847
commit 0fbf88a6c6
4 changed files with 66 additions and 61 deletions

View File

@@ -500,7 +500,7 @@ clean_orphaned_system_services() {
if [[ "$orphan_file" == *.plist ]]; then
sudo launchctl unload "$orphan_file" 2> /dev/null || true
fi
if sudo rm -f "$orphan_file" 2> /dev/null; then
if safe_sudo_remove "$orphan_file"; then
debug_log "Removed orphaned service: $orphan_file"
fi
fi