permission denied when Evince tries to use Chrome to open link
I know there are existing questions about problems with Evince opening links, but this looks like a new error. This is in 21.04 but I think the error is very recent, i.e. the links worked earlier in 21.04. So I started evince from the command line and when I tried to open a link in the document, I got this error:
[205689:205689:0812/101716.420196:FATAL:double_fork_and_exec.cc(131)] execv /opt/google/chrome/crashpad_handler: Permission denied (13)
This is evince 40.1 and Chrome 92.0.4515.131
I submitted an evince issue about this: https://gitlab.gnome.org/GNOME/evince/-/issues/1646 and determined that the problem is AppArmor, which is preventing evince from invoking Chrome (but allows it to use Firefox). So I need to modify the AppArmor profile for evince. I have no idea how to do this. I tried using aa-logprof, but I clearly need instructions that I can understand. I would appreciate any pointers that show step-by-step, how to make the necessary modification to the evince profile.
Update: Success. I added this line to the sanitized_helper profile in abstractions/ubuntu_helpers:
/opt/google/chrome/crashpad_handler Pixr,
and reloaded the evince profile. Now I get these errors when clicking on the link:
[20036:20069:0813/075235.070369:ERROR:address_tracker_linux.cc(195)] Could not create NETLINK socket: Permission denied (13)
[20036:20065:0813/075235.071590:ERROR:udev_watcher.cc(52)] Failed to initialize a udev monitor.
Opening in existing browser session.
And the link opened successfully in a new chrome tab.
Edit the file ubuntu-helpers:sudo gedit /etc/apparmor.d/abstractions/ubuntu-helpers
Under profile sanitized_helper {
,
find lines beginning /opt/google/chrome.
Add this line:/opt/google/chrome/crashpad_handler Pixr,
Save the file.
Reload the evince profile (while in /etc/apparmor.d):sudo apparmor_parser -r usr.bin.evince