Hello,
I found a workaround to this issue that doesn't involve having to install your pac file on another web server, nor activating web sharing on the local system.
First, a little more background on what I found:
After configuring my system to use a local .pac file (in my case, "proxy.pac"), I took a look at my console log messages, and found the following:
07/09/11 12:21:25.721 AM sandboxd: ([82829]) WebProcess(82829) deny file-read-data /Users/tfischer/Documents/scripts/proxy.pac
Ok - so this just confirms that the sandboxing of Safari 5.1 is preventing the WebProcess daemon from accessing the proxy.pac file.
However, Safari does a lot of stuff, and it has to be able to read some files (plugins, etc.), so the trick is to put the pac file somewhere that WebProcess can access.
After rooting around a bit, I found that there are sandbox definition/configuration files for various processes and apps in /usr/share/sandbox. These files end in ".sb", and they define all sorts of things - what files can be read, written, etc. Unfortunately, the sandbox definition file for WebProcess doesn't live in /usr/share/sandbox. Searching a little bit further revealed that the sandbox definition file is here:
/System/Library/PrivateFrameworks/Webkit2.framework/WebProcess.app/Contents/Reso urces/com.apple.WebProcess.sb
I initially thought about modifying the file to tell it that it could read /Users/tfischer/Documents/scripts/proxy.pac (with a couple lines like the following:
(allow file-read-data
(home-literal "/Users/tfischer/Documents/scripts/proxy.pac"))
but after some reflection, I decided that this wasn't a good idea: even if the modified com.apple.WebProcess.sb file worked, my changes would be wiped out the next time that Safari was updated.
Further examination of the file showed that WebProcess has read access to the "/Library/Internet Plug-Ins/" directory. So, I copied my pac file into "/Library/Internet Plug-Ins/proxy.pac", modified my network preferences to reflect the pac file's new home, and restarted Safari.
After doing this, Safari was able to use the local pac file again...
I hope this helps!
best regards,
tom