summaryrefslogtreecommitdiff
path: root/src/machine/machine-dbus.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2015-09-02 11:14:41 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2015-09-02 11:14:41 +0200
commitd18ec0491ed7c502080c03fa5fe93c8b6ac3d6ea (patch)
tree3613b205544d081eaa76656c117034754531ce73 /src/machine/machine-dbus.c
parentf22572452b55f78ec9cddfdb0229c1d93dd9ce67 (diff)
parent751090cc8ae09787402d60b7080d479b3afe3b13 (diff)
Merge pull request #1112 from poettering/sd-bus-container-fixes
machined and sd-bus container fixes
Diffstat (limited to 'src/machine/machine-dbus.c')
-rw-r--r--src/machine/machine-dbus.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
index af2b8eff06..a63b9785af 100644
--- a/src/machine/machine-dbus.c
+++ b/src/machine/machine-dbus.c
@@ -45,6 +45,7 @@
#include "formats-util.h"
#include "process-util.h"
#include "env-util.h"
+#include "terminal-util.h"
static int property_get_id(
sd_bus *bus,
@@ -500,7 +501,7 @@ int bus_machine_method_open_pty(sd_bus_message *message, void *userdata, sd_bus_
if (master < 0)
return master;
- r = ptsname_malloc(master, &pty_name);
+ r = ptsname_namespace(master, &pty_name);
if (r < 0)
return r;
@@ -589,7 +590,7 @@ int bus_machine_method_open_login(sd_bus_message *message, void *userdata, sd_bu
if (master < 0)
return master;
- r = ptsname_malloc(master, &pty_name);
+ r = ptsname_namespace(master, &pty_name);
if (r < 0)
return r;
@@ -597,9 +598,6 @@ int bus_machine_method_open_login(sd_bus_message *message, void *userdata, sd_bu
if (!p)
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "PTS name %s is invalid", pty_name);
- if (unlockpt(master) < 0)
- return -errno;
-
r = container_bus_new(m, &allocated_bus);
if (r < 0)
return r;
@@ -690,7 +688,7 @@ int bus_machine_method_open_shell(sd_bus_message *message, void *userdata, sd_bu
if (master < 0)
return master;
- r = ptsname_malloc(master, &pty_name);
+ r = ptsname_namespace(master, &pty_name);
if (r < 0)
return r;
@@ -701,9 +699,6 @@ int bus_machine_method_open_shell(sd_bus_message *message, void *userdata, sd_bu
utmp_id = path_startswith(pty_name, "/dev/");
assert(utmp_id);
- if (unlockpt(master) < 0)
- return -errno;
-
r = container_bus_new(m, &allocated_bus);
if (r < 0)
return r;