Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
disable_auto_open_safe_downloads: Add check
Browse files Browse the repository at this point in the history
- Add full disk access permission check
- See #18
  • Loading branch information
0xmachos committed Jan 21, 2019
1 parent c5ffb42 commit dd4cc33
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Lockdown
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,13 @@ function disable_auto_open_safe_downloads {

title="Disable Safari Auto Open 'safe' Files"

audit_command="defaults read com.apple.Safari AutoOpenSafeDownloads | grep -q '0'"
if ! full_disk_access_check "${title}"; then
echo " [⚠️ ] ${title} (${RED}Requires 'Full Disk Access' permission${RESET})"
echo " [🍺] See the 'Full Disk Access Permission' section of 'README.md' for instructions"
return 1
fi

audit_command="defaults read com.apple.Safari AutoOpenSafeDownloads | grep -q '0'"
fix_command="defaults write com.apple.Safari AutoOpenSafeDownloads -bool false"

mode_check "${mode}" "${title}" "${audit_command}" "${fix_command}"
Expand Down

0 comments on commit dd4cc33

Please sign in to comment.