libeos-parental-controls: Support matching against flatpak app IDs
These are the app-specific part of a flatpak ref, and are what’s available when you have a .desktop file, via the X-Flatpak key in the .desktop file. For example, for a flatpak ref ‘app/org.gnome.Builder/x86_64/master’, the app ID is ‘org.gnome.Builder’. It makes sense that we’d want to match against app IDs in some situations, since the user probably doesn’t care about the architecture or branch of the app they want to proscribe. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://phabricator.endlessm.com/T24016
This commit is contained in:
parent
49228974eb
commit
244985f45f
4 changed files with 64 additions and 2 deletions
|
@ -150,7 +150,12 @@ def command_check(user, path, quiet=False, interactive=True):
|
|||
user_id = __lookup_user_id_or_error(user)
|
||||
app_filter = __get_app_filter_or_error(user_id, interactive)
|
||||
|
||||
if path.startswith('app/') or path.startswith('runtime/'):
|
||||
if path.startswith('app/') and path.count('/') < 3:
|
||||
# Flatpak app ID
|
||||
path = path[4:]
|
||||
is_allowed = app_filter.is_flatpak_app_allowed(path)
|
||||
noun = 'Flatpak app ID'
|
||||
elif path.startswith('app/') or path.startswith('runtime/'):
|
||||
# Flatpak ref
|
||||
is_allowed = app_filter.is_flatpak_ref_allowed(path)
|
||||
noun = 'Flatpak ref'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue