From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Perry Smith Newsgroups: gmane.emacs.help Subject: Re: iCloud directory access issue on macOS Catalina Date: Thu, 10 Oct 2019 11:23:55 -0500 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3594.4.19\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="105118"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Emacs mailing list To: Pankaj Jangid Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 10 18:33:11 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIbNG-000R77-Pk for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Oct 2019 18:33:10 +0200 Original-Received: from localhost ([::1]:42250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIbNF-0005EM-3i for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Oct 2019 12:33:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42833) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIbFB-00050r-84 for help-gnu-emacs@gnu.org; Thu, 10 Oct 2019 12:24:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIbF9-0004Qc-GR for help-gnu-emacs@gnu.org; Thu, 10 Oct 2019 12:24:49 -0400 Original-Received: from crocodile.birch.relay.mailchannels.net ([23.83.209.45]:2422) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIbF9-0004JV-6M for help-gnu-emacs@gnu.org; Thu, 10 Oct 2019 12:24:47 -0400 X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 9EDDA5A11BC; Thu, 10 Oct 2019 16:24:04 +0000 (UTC) Original-Received: from mi3-ss4.a2hosting.com (100-96-14-204.trex.outbound.svc.cluster.local [100.96.14.204]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id D0FCA5A1209; Thu, 10 Oct 2019 16:24:03 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com Original-Received: from mi3-ss4.a2hosting.com ([TEMPUNAVAIL]. [68.66.200.199]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Thu, 10 Oct 2019 16:24:04 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|pedz+easesoftware.com@mi3-ss4.a2hosting.com X-MailChannels-Auth-Id: a2hosting X-Whistle-Befitting: 5bfd61161b8a91e7_1570724644437_1946204198 X-MC-Loop-Signature: 1570724644437:3651374912 X-MC-Ingress-Time: 1570724644437 Original-Received: from [162.251.11.6] (port=54718 helo=macbook-pro.localdomain) by mi3-ss4.a2hosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iIbEL-00ELOB-Bz; Thu, 10 Oct 2019 12:23:57 -0400 In-Reply-To: X-Mailer: Apple Mail (2.3594.4.19) X-AuthUser: pedz+easesoftware.com@mi3-ss4.a2hosting.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.209.45 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:121636 Archived-At: > On Oct 10, 2019, at 2:06 AM, Pankaj Jangid = wrote: >=20 > Hi, >=20 > macOS is increasingly making it difficult to access directories. Even > its own terminal required permission for CDing into icloud = directories. >=20 > I am facing the same in dired. Just wanted to know if anyone has got = this > fixed. I tried to gave "Full Disk Access" to Emacs but still getting > this error. >=20 > ``` > Debugger entered--Lisp error: (error "Listing directory failed but = =E2=80=98access-file=E2=80=99 worked") > signal(error ("Listing directory failed but =E2=80=98access-file=E2=80=99= worked")) > error("Listing directory failed but `access-file' worked") > insert-directory("/Users/pankaj/Documents/" "-al" nil t) > dired-insert-directory("/Users/pankaj/Documents/" "-al" nil nil t) > dired-readin-insert() > dired-readin() > dired-internal-noselect("~/Documents/" nil) > dired-noselect("/Users/pankaj/Documents/" nil) > dired-other-window("/Users/pankaj/Documents/" nil) > funcall-interactively(dired-other-window "/Users/pankaj/Documents/" = nil) > call-interactively(dired-other-window nil nil) > command-execute(dired-other-window) > ``` I can confirm this. I=E2=80=99m using EmacsForMacOS latest so emacs = version reports: GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1894.00 = Version 10.15 (Build 19A583)) of 2019-10-10 I have my Documents and Desktop in iCloud. I=E2=80=99ve never tried = this before. The issue seems specific to these two directories. I added Emacs to the list of =E2=80=9CFull Disk Access=E2=80=9D which = causes it to show up in =E2=80=9CFiles and Folders=E2=80=9D and I also = added it to =E2=80=9CDeveloper Tools=E2=80=9D. The problem can be seen (I think) easier by starting M-x shell: > pedz@MysticSlate / % cd > cd > pedz@MysticSlate ~ % ls > ls > Desktop Downloads Movies Pictures = Source d word-search.rb > Documents Library Music Public bin = new-gnupg > pedz@MysticSlate ~ % ls ~/Documents > ls ~/Documents > ls: Documents: Operation not permitted > pedz@MysticSlate ~ % cd Documents/ > cd Documents/ > pedz@MysticSlate Documents % ls > ls > ls: .: Operation not permitted > pedz@MysticSlate Documents % pwd > pwd > /Users/pedz/Documents > pedz@MysticSlate Documents %=20 I piddled around a bit but never succeeded. I discovered that all the = files and directories under /Applications/Emacs.app have the = com.apple.quarantine xattr so I removed that=20 sudo xattr -dr com.apple.quarantine /Applications/Emacs.app =20 =E2=80=A6 no effect I thought perhaps it was a lineage type deal. This version of emacs = actually starts up a small ruby shell and then does an exec so the final = executable running is not the original Emacs.app that the finder = spawned. You can see this below: This is the process tree before any changes (this is done at the shell = prompt inside a =E2=80=9C*shell*=E2=80=9D buffer inside Emacs) > pstree -p $$ > -+=3D 00001 root /sbin/launchd > \-+=3D 07613 pedz = /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14 > \-+=3D 07620 pedz /bin/zsh -i > \-+=3D 07624 pedz pstree -p 7620 > \--- 07625 root ps -axwwo user,pid,ppid,pgid,command I modified the script to not do an exec but just do a =E2=80=9Csystem=E2=80= =9D and so now the process stack looks like this: > pstree -p $$ > -+=3D 00001 root /sbin/launchd > \-+=3D 07655 pedz /usr/bin/ruby = /Applications/Emacs.app/Contents/MacOS/Emacs <<<<<<< > \-+- 07661 pedz = /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14 > \-+=3D 07663 pedz /bin/zsh -i > \-+=3D 07665 pedz pstree -p 7663 > \--- 07666 root ps -axwwo user,pid,ppid,pgid,command but it still does not work. This clearly isn=E2=80=99t an emacs problem. I=E2=80=99m going to go = beat the bushes in a few other places and see if I can find a solution. I also opened an issue on the EmacsForMacOS GitHub repository = pedz