From: Christian Brauner Date: Sun, 2 Jul 2017 10:49:29 +0000 (+0200) Subject: confile: lxc.pts --> lxc.pty.max X-Git-Tag: lxc-2.1.0~58^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=232763d645a893c6dd16b9d41c2cd44b14bebfb8;p=thirdparty%2Flxc.git confile: lxc.pts --> lxc.pty.max Signed-off-by: Christian Brauner --- diff --git a/config/templates/common.conf.in b/config/templates/common.conf.in index 27925221d..e13d98a7f 100644 --- a/config/templates/common.conf.in +++ b/config/templates/common.conf.in @@ -4,7 +4,7 @@ lxc.tty.dir = lxc # Allow for 1024 pseudo terminals -lxc.pts = 1024 +lxc.pty.max = 1024 # Setup 4 tty devices lxc.tty.max = 4 diff --git a/config/templates/openwrt.common.conf.in b/config/templates/openwrt.common.conf.in index 8877c498e..607bb5a3b 100644 --- a/config/templates/openwrt.common.conf.in +++ b/config/templates/openwrt.common.conf.in @@ -1,7 +1,7 @@ # Default console settings lxc.tty.dir = lxc lxc.tty.max = 4 -lxc.pts = 1024 +lxc.pty.max = 1024 # Default capabilities lxc.cap.drop = mac_admin diff --git a/config/templates/sabayon.common.conf.in b/config/templates/sabayon.common.conf.in index 0251ab5c9..e14636635 100644 --- a/config/templates/sabayon.common.conf.in +++ b/config/templates/sabayon.common.conf.in @@ -4,7 +4,7 @@ lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed # Allow for 1024 pseudo terminals -lxc.pts = 1024 +lxc.pty.max = 1024 # Setup 1 tty devices for lxc-console command lxc.tty.max = 1 diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in index 076efc455..f283649e6 100644 --- a/doc/lxc.container.conf.sgml.in +++ b/doc/lxc.container.conf.sgml.in @@ -650,7 +650,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - + diff --git a/src/lxc/confile.c b/src/lxc/confile.c index dc5a175a9..69bd4db98 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -75,7 +75,7 @@ lxc_log_define(lxc_confile, lxc); lxc_config_define(personality); -lxc_config_define(pts); +lxc_config_define(pty_max); lxc_config_define(tty_max); lxc_config_define(tty_dir); lxc_config_define(apparmor_profile); @@ -135,10 +135,15 @@ lxc_config_define(prlimit); static struct lxc_config_t config[] = { { "lxc.arch", set_config_personality, get_config_personality, clr_config_personality, }, - { "lxc.pts", set_config_pts, get_config_pts, clr_config_pts, }, + { "lxc.pty.max", set_config_pty_max, get_config_pty_max, clr_config_pty_max, }, { "lxc.tty.dir", set_config_tty_dir, get_config_tty_dir, clr_config_tty_dir, }, { "lxc.tty.max", set_config_tty_max, get_config_tty_max, clr_config_tty_max, }, + /* REMOVE IN LXC 3.0 + legacy pts key + */ + { "lxc.pts", set_config_pty_max, get_config_pty_max, clr_config_pty_max, }, + /* REMOVE IN LXC 3.0 legacy devttydir key */ @@ -1162,8 +1167,8 @@ static int set_config_personality(const char *key, const char *value, return 0; } -static int set_config_pts(const char *key, const char *value, - struct lxc_conf *lxc_conf, void *data) +static int set_config_pty_max(const char *key, const char *value, + struct lxc_conf *lxc_conf, void *data) { /* Set config value to default. */ if (lxc_config_value_empty(value)) { @@ -2794,8 +2799,8 @@ static int get_config_personality(const char *key, char *retv, int inlen, return fulllen; } -static int get_config_pts(const char *key, char *retv, int inlen, - struct lxc_conf *c, void *data) +static int get_config_pty_max(const char *key, char *retv, int inlen, + struct lxc_conf *c, void *data) { return lxc_get_conf_int(c, retv, inlen, c->pts); } @@ -3366,8 +3371,8 @@ static inline int clr_config_personality(const char *key, struct lxc_conf *c, return 0; } -static inline int clr_config_pts(const char *key, struct lxc_conf *c, - void *data) +static inline int clr_config_pty_max(const char *key, struct lxc_conf *c, + void *data) { c->pts = 0; return 0; diff --git a/src/tests/parse_config_file.c b/src/tests/parse_config_file.c index 21e630417..5550d96c9 100644 --- a/src/tests/parse_config_file.c +++ b/src/tests/parse_config_file.c @@ -300,13 +300,22 @@ int main(int argc, char *argv[]) goto non_test_error; } - /* lxc.pts */ + /* REMOVE IN LXC 3.0 + legacy ps keys + */ if (set_get_compare_clear_save_load(c, "lxc.pts", "1000", tmpf, true) < 0) { lxc_error("%s\n", "lxc.pts"); goto non_test_error; } + /* lxc.pty.max */ + if (set_get_compare_clear_save_load(c, "lxc.pty.max", "1000", tmpf, true) < + 0) { + lxc_error("%s\n", "lxc.pty.max"); + goto non_test_error; + } + /* REMOVE IN LXC 3.0 legacy tty.max keys */ diff --git a/templates/lxc-altlinux.in b/templates/lxc-altlinux.in index c39c575b7..9fde9e37c 100644 --- a/templates/lxc-altlinux.in +++ b/templates/lxc-altlinux.in @@ -278,7 +278,7 @@ copy_configuration() cat <> $config_path/config lxc.uts.name = $name lxc.tty.max = 4 -lxc.pts = 1024 +lxc.pty.max = 1024 lxc.cap.drop = sys_module mac_admin mac_override sys_time # When using LXC with apparmor, uncomment the next line to run unconfined: diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in index 36572df5d..c4ba27555 100644 --- a/templates/lxc-busybox.in +++ b/templates/lxc-busybox.in @@ -345,7 +345,7 @@ lxc.signal.halt = SIGUSR1 lxc.rebootsignal = SIGTERM lxc.uts.name = $name lxc.tty.max = 1 -lxc.pts = 1 +lxc.pty.max = 1 lxc.cap.drop = sys_module mac_admin mac_override sys_time # When using LXC with apparmor, uncomment the next line to run unconfined: diff --git a/templates/lxc-cirros.in b/templates/lxc-cirros.in index a5a8c5e9f..e884086a9 100644 --- a/templates/lxc-cirros.in +++ b/templates/lxc-cirros.in @@ -121,7 +121,7 @@ cat >> "$path/config" <> $config_path/config lxc.uts.name = $name lxc.tty.max = 4 -lxc.pts = 1024 +lxc.pty.max = 1024 lxc.cap.drop = sys_module mac_admin mac_override sys_time lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed diff --git a/templates/lxc-pld.in b/templates/lxc-pld.in index 49a8149aa..1f4f3641e 100644 --- a/templates/lxc-pld.in +++ b/templates/lxc-pld.in @@ -240,7 +240,7 @@ copy_configuration() # lxc.include = /usr/share/lxc/config/common.conf lxc.uts.name = $utsname lxc.tty.max = 4 -lxc.pts = 1024 +lxc.pty.max = 1024 # Consider if below line is right for systemd container lxc.mount.fstab = $config_path/fstab lxc.cap.drop = sys_module mac_admin mac_override sys_time diff --git a/templates/lxc-sshd.in b/templates/lxc-sshd.in index 14c03270a..3e410c3cd 100644 --- a/templates/lxc-sshd.in +++ b/templates/lxc-sshd.in @@ -130,7 +130,7 @@ copy_configuration() grep -q "^lxc.rootfs.path" $path/config 2>/dev/null || echo "lxc.rootfs.path = $rootfs" >> $path/config cat <> $path/config lxc.uts.name = $name -lxc.pts = 1024 +lxc.pty.max = 1024 lxc.cap.drop = sys_module mac_admin mac_override sys_time # When using LXC with apparmor, uncomment the next line to run unconfined: