Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.4: Modify how the system classifies 'safe' files System 10.4
Tiger only hintYou can modifying what Safari considers a 'safe' file using a local file that will override the global file-type security assessments.

If there's a file named com.apple.DownloadAssessment.plist in your user's Library/Preferences folder, it will override the global defaults for which files Safari considers "safe." You can also use this technique to make currently-safe files treated as unsafe. In fact, there are four different top-level risk categories:
  • LSRiskCategorySafe - Auto-opened after download, if Safari has this option enabled.
  • LSRiskCategoryNeutral - A neutral file won't be auto-opened, but there won't be a warning about its contents, either.
  • LSRiskCategoryUnsafeExecutable - All executable files fall into this category, and you'll see a warning when you attempt to download one in Safari, Mail, etc.
  • LSRiskCategoryMayContainUnsafeExecutable - This covers 'container' formats such as disk images and archives. If Safari/Mail can see the contents of the container and determine they're all safe, then no warning will be generated.
For more details on how to create your own custom settings for various file types using the com.apple.DownloadAssessment.plist file, see Modifying Safari Safe Files on the MacEnterprise.org website.

[robg adds: I haven't tested this one, but I would suggest caution if you're going to change how certain downloaded filetypes are handled...]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[16,768 views]  

10.4: Modify how the system classifies 'safe' files | 20 comments | Create New Account
Click here to return to the '10.4: Modify how the system classifies 'safe' files' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.4: Modify how the system classifies 'safe' files
Authored by: Angel-fr on Tue, Dec 27 2005 at 7:09AM PST
i dont have this file , i dont know why.. im using mac os X 10.4.3

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: Angel-fr on Wed, Dec 28 2005 at 11:59AM PST
Please help men i cant find this file anywhere

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: uurazzle on Wed, Dec 28 2005 at 12:23PM PST
The file DOES NOT exist by default, you need to create it and save it the user's Preferences folder. You can use a text editor like BBEdit/SubEthaEdit or plist tools like Apple Developer tool Property List Editor or shareware utility Plist Editor Pro to create the plist file.

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: Angel-fr on Thu, Dec 29 2005 at 3:01AM PST
hmmmm thanks you dude

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: xwiz on Tue, Dec 27 2005 at 8:37AM PST
Maybe I don't know enough about plists or something, but I can't get this to work. I just want Safari to stop asking if I'm sure I wanted to download an application, and I'd like it to automatically open bittorrents.

No joy, so far... can anyone explain a little more?

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: uurazzle on Wed, Dec 28 2005 at 12:47PM PST
I just double-checked this and will work if you use the XML code noted in example 3...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>LSRiskCategoryNeutral</key>
  <dict>
    <key>LSRiskCategoryContentTypes</key>
    <array>
      <string>com.apple.application</string>
    </array>
  </dict>
</dict>
</plist>

Then quit/relaunch Safari and test downloading a dmg with app and you will NOT get a prompt.

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: xwiz on Fri, Dec 30 2005 at 8:59AM PST
Ah, excellent - that works. I was missing the first line.

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: inspired_tmu on Tue, Dec 27 2005 at 10:46AM PST
Or use Saft to disable the warning.

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: iceberg18 on Tue, Dec 27 2005 at 11:28AM PST
OK, but how can I stop Safari from automatically appending ".txt" to files?

Everytime I download firmware, whether for my server, router, etc. it thinks the file should be appended, when I rather it didn't because right now I have to go to the "Get info" window to remove the ".txt" each time.

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: vykor on Wed, Dec 28 2005 at 12:54AM PST
The most likely cause - whichever server you're retrieving those files from are serving the files with the wrong mimetype. Safari appends .txt to those files being served with the mimetype for text/html or whichever - because in essence it was told that the file <i>is</i> text.

If you can contact the webserver admins and have the server configuration fixed to serve the proper type, this'll go away. I haven't figured out a way to stop this behavior in Safari yet, but apparently a bug report about this has already been filed on Radar.

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: ra5ul on Tue, Dec 27 2005 at 2:50PM PST
is that link reliable? how could example 1 be declaring "safe" files and example 2 be declaring "unsafe" files?


[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: uurazzle on Wed, Dec 28 2005 at 12:19PM PST
Yes, the link is reliable. It is my article and I have tested it with Mac OS X 10.4.3 and Safari Version 2.0.2 (416.13). For instance, example 1 with declares Citrix ICA files to be "safe" using uniform type identifier com.citrix.ICAClient.plist works for me. Note, that the plist file com.apple.DownloadAssessment.plist doesn't exist by default and I tested with the file in the current user's ~/Library/Preferences/ folder. I needed to quit/relaunch Safari after adding or modifying the com.apple.DownloadAssessment.plist file and you need the Safari setting 'Open "safe" files after downloading' enabled.

So, once I had the file created in the users Preferences folder with the proper XML info and quit/relaunch Safari, when I download a Citrix ICA file, for example *.ica, it downloads and then auto-opens the file into the Citrix ICA application.

There was a typo, in example two which I have fixed. It should have been "LSRiskCategoryUnsafeExecutable" NOT "LSRiskCategorySafe". Sorry about that error, and thanks for pointing it out.

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: ra5ul on Wed, Dec 28 2005 at 6:15PM PST
nice. after some more testing, i can affirm that this does work, but only partially (at least in my case: safari 2.0.2/416.13).

for example, using .pdf extensions w/LSRiskCategoryUnsafeExecutable did pop up the warning, but using it w/LSRiskCategoryNeutral didn't prevent pdf files from auto-opening. similarly, i couldn't get any key/string values to stop safari from auto-opening .gz or tar.gz files.

it seems like the user.plist file doesn't totally "override" the system one. where is the system config file, by the way?

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: uurazzle on Wed, Dec 28 2005 at 9:17PM PST
If you are concerned with pdf, gz or tar.gz, why not simply disable the 'Open "safe" files after download' option in Safari?

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: clknight on Sat, Dec 31 2005 at 2:11PM PST
Made many attempts on this, no luck.

---
Chris

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: macosyhints on Tue, May 23 2006 at 2:23AM PDT
make sure you have converted your text file to flat text (cmd-shift-t) before saving it.

[ Reply to This | # ]
Taboo
Authored by: KenaiTheMacFan on Sat, Dec 31 2005 at 3:33PM PST
I use Taboo to disable all of the security warnings. Taboo also prevents accidental closure of tabbed windows.

---
Ian

[ Reply to This | # ]

No success with .SIT files
Authored by: GeJe on Sun, Apr 30 2006 at 5:41AM PDT
I can't get it to work with .SIT files, here is my file :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>LSRiskCategorySafe</key>
  <dict>
    <key>LSRiskCategoryExtensions</key>
    <array>
      <string>sit</string>
    </array>
  </dict>
</dict>
</plist>
Anyone have an idea why ? I'm using Taboo, can this one be conflicting with the post processing of .SIT files ? thanks !

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: gothgod on Sat, Aug 18 2007 at 1:33AM PDT
This is not working, are downloads handled differently in the new safari 3?

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: Eponymous on Sun, May 25 2008 at 10:03PM PDT
It works for me. Be careful with the typing (I copied-and-pasted into Terminal), and make sure you're using the right values. Refer to the original posting on the Macenterprise site.

I just set up Safari to auto-open Google Earth .kml files, for example.

[ Reply to This | # ]