Unverified Commit 4f9500b1 by Christian Brauner Committed by GitHub

Merge pull request #2553 from Blub/ttydir-path-fixup

conf: fix path/lxcpath mixups in tty setup
parents 89a9f393 adc1c715
...@@ -928,7 +928,7 @@ static int lxc_setup_ttys(struct lxc_conf *conf) ...@@ -928,7 +928,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;
...@@ -942,12 +942,12 @@ static int lxc_setup_ttys(struct lxc_conf *conf) ...@@ -942,12 +942,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