So, the first thing I tried is to add the following in the snap'sapparmor profile:#include <abstractions/nameservice>#include <abstractions/bash>And this got rid of the bashrc access errors (which likely aren't fatal,anyway), and I could get a proper result with this:aa-exec -p snap.inkscape.inkscape getent passwd $UIDSo, I thought this would work. However, it still doesn't...
With careful use of ctrl-Z and attaching strace (since it seems you can't strace directly), I was able to see that the /etc/nsswitch.conf being used by inkscape is coming from inside a chroot or otherwise remapped by snap, and it does not use the system /etc/nsswitch.conf.
All this to say -- would it be possible to have a fallback in the environment to use the old behaviour (was it to use $HOME as REALHOME?) in case the calls to getent fail? Or, at the least, it should be documented that using nscd/unscd is required when a different nsswitch.conf configuration is used.