From 395745ba533ac91fe118f43ec83f13a752c0b473 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 1 Sep 2015 19:39:14 +0200 Subject: machined: call unlockpt() in container, not host It makes assumptions about the pty path, hence better call it in the container namespace rather than the host. --- src/run/run.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/run') diff --git a/src/run/run.c b/src/run/run.c index a69560208c..657c6fcaf1 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -702,6 +702,9 @@ static int start_transient_service( if (r < 0) return log_error_errno(r, "Failed to determine tty name: %m"); + if (unlockpt(master) < 0) + return log_error_errno(errno, "Failed to unlock tty: %m"); + } else if (arg_transport == BUS_TRANSPORT_MACHINE) { _cleanup_bus_unref_ sd_bus *system_bus = NULL; const char *s; @@ -738,9 +741,6 @@ static int start_transient_service( return log_oom(); } else assert_not_reached("Can't allocate tty via ssh"); - - if (unlockpt(master) < 0) - return log_error_errno(errno, "Failed to unlock tty: %m"); } if (!arg_no_block) { -- cgit v1.2.3-54-g00ecf