[lxc-devel] [lxc/master] conf: fix path/lxcpath mixups in tty setup

Blub on Github lxc-bot at linuxcontainers.org
Mon Aug 20 08:12:39 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 427 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180820/9b9e1511/attachment.bin>
-------------- next part --------------
From adc1c7156ce35881d55bd51f9f6a390627011b05 Mon Sep 17 00:00:00 2001
From: Wolfgang Bumiller <w.bumiller at proxmox.com>
Date: Mon, 20 Aug 2018 10:02:35 +0200
Subject: [PATCH] conf: fix path/lxcpath mixups in tty setup

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
Fixes: 6947153da ("conf: use mknod() to create dummy mount target")
---
 src/lxc/conf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 4507dc7e2..9ce6689df 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -928,7 +928,7 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
 			if (ret < 0 || (size_t)ret >= sizeof(lxcpath))
 				return -1;
 
-			ret = mknod(path, S_IFREG | 0000, 0);
+			ret = mknod(lxcpath, S_IFREG | 0000, 0);
 			if (ret < 0 && errno != EEXIST) {
 				SYSERROR("Failed to create \"%s\"", lxcpath);
 				return -1;
@@ -942,12 +942,12 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
 
 			ret = mount(tty->name, lxcpath, "none", MS_BIND, 0);
 			if (ret < 0) {
-				WARN("Failed to bind mount \"%s\" onto \"%s\"",
-				     tty->name, path);
+				SYSWARN("Failed to bind mount \"%s\" onto \"%s\"",
+				     tty->name, lxcpath);
 				continue;
 			}
 			DEBUG("Bind mounted \"%s\" onto \"%s\"", tty->name,
-			      path);
+			      lxcpath);
 
 			ret = snprintf(lxcpath, sizeof(lxcpath), "%s/tty%d",
 				       ttydir, i + 1);


More information about the lxc-devel mailing list