0

I'm working on a MacBook Pro with 10.8.5 (fully patched). I'm trying to add a new platform to OpenSSL's Configure script (Android, x86):

enter image description here

I right click on Configure and browse to an text editor (such as TextEdit.app or TextMate.app):

enter image description here

When I try to open the file as text for read/write (not execute), I always get an error:

enter image description here

I can execute the same file from the command line, but I can't read it into a text editor from the UI. (This is before I execute xattr -r -d "com.apple.quarantine *).

Question: Why am I allowed to execute the banned script, but not allowed to open it in a text editor?

For all files I attempt to open through Finder, if I check Always Open With, the setting is not preserved and I have to select an app the next time I try to open the file.

Question: How do make Finder retain the Always Open With setting?

This annoying behavior has been occurring for years. I recall experiencing it back in the OS X 10.6 and OS X 10.7 days.

1 Answer 1

1

Question: Why am I allowed to execute the banned script, but not allowed to open it in a text editor?

Using terminal to open a script will bypass the GateKeeper settings. When opening a file using an application, GateKeeper will kick and prevent you from doing things. I would suggest trying a couple of things:

  1. Disable or alter GateKeeper settings in System Preferences > Security and Privacy > General.
  2. Try opening the application you wish to use to view the content and open the file directly
  3. Try using the open command from terminal with the -a flag.
    open -a /Applications/TextMate.app path/to/file
  4. Use a Terminal editor such as vim or nano.

Question: How do make Finder retain the Always Open With setting?

This might be an issue because the file-type you are opening is not allowed to open at all in the first-place. See if this continues to happen after disabling GateKeeper.

You can also do a Get Info on a specific file-type to see what application is set to open that file-type. Maybe you found a bug with OS X and the launch services process?

2
  • Thanks. For some reason, I thought GateKeeper was essentially code signing (which I know more about on iOS). I did not know it was at play here (I guess I never made the connection), and that it could be trivially bypassed.
    – jww
    Jun 14, 2014 at 0:02
  • GateKeeper does rely on Code Signing, and given the screen shot, it's highly likely your Configure script is marked as executable. So OS X is going to treat it as such and restrict how it's going to be opened. Since it's not signed, it's getting blocked. But yes, it seems trivial to bypass it with Terminal.
    – Andrew
    Jun 14, 2014 at 23:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .