0

I use macOS Monterey, and my problem appears to be similar to

Getting operation not permitted when trying to open projects or use integrated terminal in emacs-doom

but the solution there (giving ruby full disk access) doesn't work.

When I try to open a file in Desktop (/Users/yourname/Desktop/ ), the emacs minibuffer shows "Reading directory: Operation not permitted, /Users/yourname/Desktop/".

I've already given full disk access to Emacs.app and ruby. Indeed emacs Dired can list the contents of any directories (/etc/, /usr/, . . . ), except for Desktop.

Desktop can be accessed by other applications, like iterm2 and GIMP, which I've given full disk access to.

This may be related to the cloudification of Desktop, but I haven't been able to find discussion that seems to be related to my problem on the Net.

1
  • 1
    fyi, one gives ruby "full disk access" because some distributions of Emacs (like emacsforosx) use a ruby file as a wrapper around the Emacs executable inside Emacs.app. Railwaycat Emacs does not, so naturally that won't work.
    – nega
    Apr 29 at 4:04

2 Answers 2

1

I'm facing similar issue when upgrade Emacs. I suggest resetting Emacs privacy permission by sudo tccutil reset All org.gnu.Emacs and add full disk access to Emacs.app again in system preferences.

3
  • Thank you for your great suggestion! I got tccutil: executable_is_endpoint_security_client failed for path file:///usr/local/Cellar/emacs-mac/emacs-28.1-mac-9.0/Emacs.app/Contents/MacOS/Emacs with error: code object is not signed at all from the tccutil command. Does that mean that Emacs.app doesn't pass the security clearance of macOS ?
    – Ryo
    Apr 27 at 3:26
  • 1
    You can codesign Emacs yourself through codesign --force --deep --sign - /Applications/Emacs.app and now tccutil works fine. Apr 27 at 13:30
  • Thanks! I've edited my answer to quote your comment above. That should have been the solution to my problem.
    – Ryo
    Apr 29 at 3:17
0

Thanks to Tianshu Wang's posting, I was able to solve the problem. In the following, I don't know whether step 1 was necessary or not. Probably not.

  1. sudo tccutil reset All org.gnu.Emacs fails with

    tccutil: executable_is_endpoint_security_client failed for path file:///usr/local/Cellar/emacs-mac/emacs-28.1-mac 9.0/Emacs.app/Contents/MacOS/Emacs with error: code object is not signed at all

From this, I guessed that there is something wrong with Emacs.app itself.

  1. I removed emacs (brew rm emacs-mac) and installed it again (brew install railwaycat/emacsmacport/emacs-mac).

That cured the problem. During the installation, I noticed that emacs was compiled from source (I think). That was, I guess, the cure.

Unfortunately, I don't still know what really was the problem. Here I just report how the problem was fixed.

Edit: In her/his comment, Tianshu Wang says,

You can codesign Emacs yourself through codesign --force --deep --sign - /Applications/Emacs.app and now tccutil works fine

I haven't tested this, but it should have fixed my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.