[lxc-devel] [lxc/master] execute: do not check inherited fds again

brauner on Github lxc-bot at linuxcontainers.org
Tue May 8 15:59:54 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 521 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180508/edf22298/attachment.bin>
-------------- next part --------------
From 76078401a1a8a9699be04e265ca74aa3a80a6977 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Tue, 8 May 2018 17:58:36 +0200
Subject: [PATCH] execute: do not check inherited fds again

This is already done in do_lxcapi_start{l}() so a) no need to do it again here
and b) this would close the state socket pair sockets and corrupt memory.

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

diff --git a/src/lxc/execute.c b/src/lxc/execute.c
index c7320ab2d..d2a6edc64 100644
--- a/src/lxc/execute.c
+++ b/src/lxc/execute.c
@@ -116,9 +116,6 @@ int lxc_execute(const char *name, char *const argv[], int quiet,
 {
 	struct execute_args args = {.argv = argv, .quiet = quiet};
 
-	if (lxc_check_inherited(handler->conf, false, &handler->conf->maincmd_fd, 1))
-		return -1;
-
 	handler->conf->is_execute = 1;
 	return __lxc_start(name, handler, &execute_start_ops, &args, lxcpath,
 			   backgrounded, error_num);


More information about the lxc-devel mailing list