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

xmcqueen on Github lxc-bot at linuxcontainers.org
Sun Jun 2 15:17:36 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 330 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190602/1b6ff0d5/attachment.bin>
-------------- next part --------------
From 2a8c00243e2024dd1f655c6dc4e18dd43bbc7261 Mon Sep 17 00:00:00 2001
From: Brian McQueen <bmcqueen at bmcqueen-mn2.linkedin.biz>
Date: Sun, 2 Jun 2019 08:15:48 -0700
Subject: [PATCH] lxc_usernsexec: continuing after unshare fails leads to
 confusing and misleading error messages

---
 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