Unverified Commit 0cf1cbf2 by Wolfgang Bumiller Committed by Christian Brauner

conf: fix path/lxcpath mixups in tty setup

Signed-off-by: 's avatarWolfgang Bumiller <w.bumiller@proxmox.com> Fixes: 6947153d ("conf: use mknod() to create dummy mount target")
parent 152c0dc8
...@@ -902,7 +902,7 @@ static int lxc_setup_ttys(struct lxc_conf *conf) ...@@ -902,7 +902,7 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
if (ret < 0 || (size_t)ret >= sizeof(lxcpath)) if (ret < 0 || (size_t)ret >= sizeof(lxcpath))
return -1; return -1;
ret = mknod(path, S_IFREG | 0000, 0); ret = mknod(lxcpath, S_IFREG | 0000, 0);
if (ret < 0 && errno != EEXIST) { if (ret < 0 && errno != EEXIST) {
SYSERROR("Failed to create \"%s\"", lxcpath); SYSERROR("Failed to create \"%s\"", lxcpath);
return -1; return -1;
...@@ -916,12 +916,12 @@ static int lxc_setup_ttys(struct lxc_conf *conf) ...@@ -916,12 +916,12 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
ret = mount(tty->name, lxcpath, "none", MS_BIND, 0); ret = mount(tty->name, lxcpath, "none", MS_BIND, 0);
if (ret < 0) { if (ret < 0) {
WARN("Failed to bind mount \"%s\" onto \"%s\"", SYSWARN("Failed to bind mount \"%s\" onto \"%s\"",
tty->name, path); tty->name, lxcpath);
continue; continue;
} }
DEBUG("Bind mounted \"%s\" onto \"%s\"", tty->name, DEBUG("Bind mounted \"%s\" onto \"%s\"", tty->name,
path); lxcpath);
ret = snprintf(lxcpath, sizeof(lxcpath), "%s/tty%d", ret = snprintf(lxcpath, sizeof(lxcpath), "%s/tty%d",
ttydir, i + 1); ttydir, i + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment