diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 0724677b9..a511c4c41 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -7942,9 +7942,15 @@ flatpak_dir_check_parental_controls (FlatpakDir *self, gboolean repo_installation_allowed, app_is_appropriate; /* Assume that root is allowed to install any ref and shouldn't have any - * parental controls restrictions applied to them */ - if (getuid () == 0) - return TRUE; + * parental controls restrictions applied to them. Note that this branch + * must not be taken if this code is running within the system-helper, as that + * runs as root but on behalf of another process. If running within the + * system-helper, self->source_pid is non-zero. */ + if (self->source_pid == 0 && getuid () == 0) + { + g_debug ("Skipping parental controls check for %s due to running as root", ref); + return TRUE; + } /* The ostree-metadata and appstream/ branches should not have any parental * controls restrictions. Similarly, for the moment, there is no point in