Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 2.25 / 5
  You rated: 2 / 5 (4 votes cast)
 
[31,204 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 whoever 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 Dec 27, '05 07:09:13AM

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 Dec 28, '05 11:59:31AM

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 Dec 28, '05 12:23:44PM

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 Dec 29, '05 03:01:56AM

hmmmm thanks you dude



[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: xwiz on Dec 27, '05 08:37:08AM

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 Dec 28, '05 12:47:49PM

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 Dec 30, '05 08:59:36AM

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 Dec 27, '05 10:46:51AM
Or use Saft to disable the warning.

[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: iceberg18 on Dec 27, '05 11:28:34AM

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 Dec 28, '05 12:54:02AM

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 Dec 27, '05 02:50:00PM

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 Dec 28, '05 12:19:33PM

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 Dec 28, '05 06:15:19PM

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 Dec 28, '05 09:17:18PM

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 Dec 31, '05 02:11:54PM

Made many attempts on this, no luck.

---
Chris



[ Reply to This | # ]
10.4: Modify how the system classifies 'safe' files
Authored by: macosyhints on May 23, '06 02:23:39AM

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 Dec 31, '05 03:33:56PM
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 Apr 30, '06 05:41:07AM
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 Aug 18, '07 01:33:27AM

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 May 25, '08 10:03:11PM

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 | # ]