2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 16:57:57 +00:00

Merge pull request #1722 from brauner/2017-07-31/devpts_use_max_mount_option

devpts: use max=<count> option on mount
This commit is contained in:
Serge Hallyn
2017-08-01 14:59:06 -05:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@@ -1332,7 +1332,8 @@ static int setup_pivot_root(const struct lxc_rootfs *rootfs)
static int lxc_setup_devpts(int num_pts)
{
int ret;
const char *devpts_mntopts = "newinstance,ptmxmode=0666,mode=0620,gid=5";
const char *default_devpts_mntopts = "newinstance,ptmxmode=0666,mode=0620,gid=5";
char devpts_mntopts[256];
if (!num_pts) {
DEBUG("no new devpts instance will be mounted since no pts "
@@ -1340,6 +1341,11 @@ static int lxc_setup_devpts(int num_pts)
return 0;
}
ret = snprintf(devpts_mntopts, sizeof(devpts_mntopts), "%s,max=%d",
default_devpts_mntopts, num_pts);
if (ret < 0 || (size_t)ret >= sizeof(devpts_mntopts))
return -1;
/* Unmount old devpts instance. */
ret = access("/dev/pts/ptmx", F_OK);
if (!ret) {

View File

@@ -146,6 +146,7 @@ static int test_console(const char *lxcpath,
}
c->load_config(c, NULL);
c->set_config_item(c, "lxc.tty.max", TTYCNT_STR);
c->set_config_item(c, "lxc.pty.max", "1024");
c->save_config(c, NULL);
c->want_daemonize(c, true);
if (!c->startl(c, 0, NULL)) {