[lxc-devel] [lxd/master] terminal: do not chown master fd

brauner on Github lxc-bot at linuxcontainers.org
Tue Mar 12 21:41:49 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 436 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190312/8d4443af/attachment.bin>
-------------- next part --------------
From abed5b552a466de20f40b4871dcedfdffccdeb68 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Tue, 12 Mar 2019 22:40:13 +0100
Subject: [PATCH] terminal: do not chown master fd

Otherwise you'll change the permissions on /dev/ptmx which is bad...

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 shared/util_linux_cgo.go | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/shared/util_linux_cgo.go b/shared/util_linux_cgo.go
index f4dc152519..faf37d260e 100644
--- a/shared/util_linux_cgo.go
+++ b/shared/util_linux_cgo.go
@@ -110,10 +110,6 @@ void create_pty(int *master, int *slave, uid_t uid, gid_t gid) {
 		fprintf(stderr, "Warning: error chowning pty to container root\n");
 		fprintf(stderr, "Continuing...\n");
 	}
-	if (fchown(*master, uid, gid) < 0) {
-		fprintf(stderr, "Warning: error chowning pty to container root\n");
-		fprintf(stderr, "Continuing...\n");
-	}
 }
 
 void create_pipe(int *master, int *slave) {


More information about the lxc-devel mailing list