mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-03 21:49:06 -04:00
run: Don't install polkit agent for enter/run/build
Neither of these ever need a polkit agent, and run/build are somewhat performance sensitive and we don't want to connect to dbus unnecessarily. For enter this is critical though, as the dbus connection starts a thread which is not compatible with the setns syscall.
This commit is contained in:
committed by
Alexander Larsson
parent
7079c6c722
commit
180494ca41
@@ -745,7 +745,12 @@ flatpak_run (int argc,
|
||||
|
||||
check_environment ();
|
||||
|
||||
polkit_agent = install_polkit_agent ();
|
||||
/* Don't talk to dbus in enter, as it must be thread-free to setns, also
|
||||
skip run/build for performance reasons (no need to connect to dbus). */
|
||||
if (g_strcmp0 (command->name, "enter") != 0 &&
|
||||
g_strcmp0 (command->name, "run") != 0 &&
|
||||
g_strcmp0 (command->name, "build") != 0)
|
||||
polkit_agent = install_polkit_agent ();
|
||||
|
||||
if (!command->fn (argc, argv, cancellable, &error))
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user