[lxc-devel] [lxc/master] lxc_usernsexec: continuing after unshare fails leads to confusing and…

xmcqueen on Github lxc-bot at linuxcontainers.org
Tue Jun 4 13:48:11 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 386 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190604/357407a4/attachment.bin>
-------------- next part --------------
From dfe4a687a2c2f531fbdba551ff2c05f82cedb6a3 Mon Sep 17 00:00:00 2001
From: Brian McQueen <bmcqueen at linkedin.com>
Date: Tue, 4 Jun 2019 06:46:37 -0700
Subject: [PATCH] lxc_usernsexec: continuing after unshare fails leads to
 confusing and misleading error messages

Signed-off-by: Brian McQueen <bmcqueen at linkedin.com>
---
 src/lxc/cmd/lxc_usernsexec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lxc/cmd/lxc_usernsexec.c b/src/lxc/cmd/lxc_usernsexec.c
index 3641d94dfb..608001e8cd 100644
--- a/src/lxc/cmd/lxc_usernsexec.c
+++ b/src/lxc/cmd/lxc_usernsexec.c
@@ -441,8 +441,10 @@ int main(int argc, char *argv[])
 	close(pipe_fds2[0]);
 
 	ret = lxc_read_nointr(pipe_fds1[0], buf, 1);
-	if (ret <= 0)
+	if (ret <= 0) {
 		CMD_SYSERROR("Failed to read from pipe file descriptor %d", pipe_fds1[0]);
+		_exit(EXIT_FAILURE);
+	}
 
 	buf[0] = '1';
 


More information about the lxc-devel mailing list