Just like in nspawn, there's a chance we need to PK authenticate the
registration, hence let's spawn off the agent for that during that
phase, and terminate it once we don't need it anymore.
#include "path-lookup.h"
#include "path-util.h"
#include "pidref.h"
+#include "polkit-agent.h"
#include "pretty-print.h"
#include "process-util.h"
#include "ptyfwd.h"
const char *accel, *shm;
int r;
+ polkit_agent_open();
+
if (arg_privileged)
r = sd_bus_default_system(&bus);
else
return r;
}
+ /* All operations that might need Polkit authorizations (i.e. machine registration, netif
+ * acquisition, …) are complete now, get rid of the agent again, so that we retain exclusive control
+ * of the TTY from now on. */
+ polkit_agent_close();
+
_cleanup_(sd_event_source_unrefp) sd_event_source *notify_event_source = NULL;
_cleanup_(sd_event_unrefp) sd_event *event = NULL;
r = sd_event_new(&event);