[lxc-devel] [lxc/master] conf: don't send ttys when none are configured

brauner on Github lxc-bot at linuxcontainers.org
Mon Sep 4 12:35:57 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170904/819d49f0/attachment.bin>
-------------- next part --------------
From 1f9bbd230c774570826c96101b9382802d809caf Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 4 Sep 2017 14:35:02 +0200
Subject: [PATCH] conf: don't send ttys when none are configured

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/conf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index f5922377b..4e304830e 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -3072,6 +3072,9 @@ static int lxc_send_ttys_to_parent(struct lxc_handler *handler)
 	int sock = handler->data_sock[0];
 	int ret = -1;
 
+	if (!conf->tty)
+		return 0;
+
 	for (i = 0; i < conf->tty; i++) {
 		int ttyfds[2];
 		struct lxc_pty_info *pty_info = &tty_info->pty_info[i];


More information about the lxc-devel mailing list