alexmurray / emacs-snap

GNU Emacs in a snap
https://snapcraft.io/emacs
71 stars 13 forks source link

Cannot start emacs when CWD is an NFS mount #26

Closed kmasaryk closed 3 years ago

kmasaryk commented 3 years ago

Attempting to start emacs while the current working dir is an NFS mount produces the following error, regardless of permissions:

cannot open path of the current working directory: Permission denied

dmesg shows the following error:

audit: type=1400 audit(1613952522.168:51): apparmor="DENIED" operation="sendmsg" profile="/usr/lib/snapd/snap-confine" pid=1888056 comm="snap-confine" laddr=<desktop ip> lport=898 faddr=<nfs server ip> fport=2049 family="inet" sock_type="stream" protocol=6 requested_mask="send" denied_mask="send"

Steps to reproduce:

  1. Install snap package.
  2. cd to an NFS mounted dir.
  3. Confirm the current user has r/w permissions to the current dir (and is not root).
  4. Attempt to run 'emacs'.

Installed version is 27.1 from latest/stable.

alexmurray commented 3 years ago

This looks like a general issue with snaps, not something specific to the emacs snap itself - https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1662552 - closing since there isn't much the emacs snap itself can do in this case as snap-confine is run before the emacs-snap gets a chance to do anything.

kmasaryk commented 3 years ago

OK, that was my impression too after a little googling but I wasn't sure so thought I'd bring it up. Thanks for looking into it.

ramayer commented 2 years ago

The same issue happens if you attempt to run it from an encfs

 $ encfs --idle 30 /tmp/.encfs_test /tmp/encfs_test
    # pick the defaults for all the prompts
 $ cd /tmp/encfs_test
 $ emacs 

Yes, I understand it's snap's fault. Just mentioning it here so if anyone else googles it, they might find this ticket.