run: also enable interactive authentication on opening pty
This commit is contained in:
+4
-2
@@ -1730,6 +1730,8 @@ static int start_transient_service(sd_bus *bus) {
|
||||
|
||||
assert(bus);
|
||||
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
if (arg_stdio == ARG_STDIO_PTY) {
|
||||
|
||||
if (IN_SET(arg_transport, BUS_TRANSPORT_LOCAL, BUS_TRANSPORT_CAPSULE)) {
|
||||
@@ -1765,6 +1767,8 @@ static int start_transient_service(sd_bus *bus) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to connect to system bus: %m");
|
||||
|
||||
(void) sd_bus_set_allow_interactive_authorization(system_bus, arg_ask_password);
|
||||
|
||||
r = bus_call_method(system_bus,
|
||||
bus_machine_mgr,
|
||||
"OpenMachinePTY",
|
||||
@@ -1819,8 +1823,6 @@ static int start_transient_service(sd_bus *bus) {
|
||||
return r;
|
||||
slave = safe_close(slave);
|
||||
|
||||
(void) polkit_agent_open_if_enabled(arg_transport, arg_ask_password);
|
||||
|
||||
r = bus_call_with_hint(bus, m, "service", &reply);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user