-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
desktop: fix fonts access #12872
desktop: fix fonts access #12872
Conversation
Inside /etc/fonts/conf.avail are several soft links to files at /usr/share/fontconfig. Although AppArmour rules are in place to allow access to that folder to snaps that have the desktop plug connected, the folder itself isn't being mounted inside the container, thus it isn't accessible from inside. This patch adds that folder to the list of font folders, to ensure that it is available from inside a container. Fix https://bugs.launchpad.net/snapd/+bug/2017313
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure about whether this is worth doing. Most desktop snaps won't be using the config under /etc/fonts
, as the desktop-launch script does:
export FONTCONFIG_PATH="$SNAP_DESKTOP_RUNTIME/etc/fonts"
export FONTCONFIG_FILE="$SNAP_DESKTOP_RUNTIME/etc/fonts/fonts.conf"
So they're oblivious to whether the symlinks in /etc/fonts/conf.d
are dangling. We haven't been using the system font configuration in a long time, as there is no guarantee that it will be compatible with the libfontconfig inside the sandbox.
The library's configuration parser has poor forward compatibility, as it will reject configurations with unknown elements/attributes. This last showed up when config files started adding <its:rules>
elements that weren't supported by older libfontconfigs.
It's been a while since the last config language update, but encouraging snaps to use the system configuration just sets us up to repeat those problems should it change again.
@jhenstridge That's a good point... so then it's better to encourage snap groups to include any font that they would need, like in the case of Steam. |
@sergio-costas as I see you could close this pr. Thanks for your help digging on this problem. |
@sergiocazzolato Ops... sorry, I completely forgot about this. Closing. |
Inside /etc/fonts/conf.avail are several soft links to files at /usr/share/fontconfig. Although AppArmour rules are in place to allow access to that folder to snaps that have the desktop plug connected, the folder itself isn't being mounted inside the container, thus it isn't accessible from inside.
This patch adds that folder to the list of font folders, to ensure that it is available from inside a container.
Fix https://bugs.launchpad.net/snapd/+bug/2017313