]> git.proxmox.com Git - mirror_lxc.git/commitdiff
confile: rename lxc.devttydir to lxc.tty.dir
author0x0916 <w@laoqinren.net>
Wed, 28 Jun 2017 10:44:18 +0000 (18:44 +0800)
committer0x0916 <w@laoqinren.net>
Fri, 30 Jun 2017 01:41:25 +0000 (09:41 +0800)
the legacy keys will be kept around until LXC 3.0 and then will be
removed

Signed-off-by: 0x0916 <w@laoqinren.net>
20 files changed:
config/templates/alpine.common.conf.in
config/templates/archlinux.common.conf.in
config/templates/common.conf.in
config/templates/debian.common.conf.in
config/templates/gentoo.common.conf.in
config/templates/openwrt.common.conf.in
config/templates/plamo.common.conf.in
config/templates/sabayon.common.conf.in
config/templates/slackware.common.conf.in
config/templates/ubuntu.lucid.conf.in
config/templates/userns.conf.in
config/templates/voidlinux.common.conf.in
src/lxc/confile.c
src/tests/parse_config_file.c
templates/lxc-archlinux.in
templates/lxc-centos.in
templates/lxc-fedora-legacy.in
templates/lxc-fedora.in
templates/lxc-oracle.in
templates/lxc-sparclinux.in

index b3444261f9e244e43e1b6944c87c84a0b897da4a..934fee28e085bc3f94f332257f7a7ad3bc55ab14 100644 (file)
@@ -2,7 +2,7 @@
 lxc.include = @LXCTEMPLATECONFIG@/common.conf
 
 # Doesn't support consoles in /dev/lxc/.
-lxc.devttydir =
+lxc.tty.dir =
 
 # Drop another (potentially) harmful capabilities.
 lxc.cap.drop = audit_write
index 043b27cc5ed1af0f9b461759076d471f8f739d99..7da478f81d8eb12cdbfe91632b5d7006cfb7d867 100644 (file)
@@ -9,7 +9,7 @@ lxc.signal.halt=SIGRTMIN+4
 lxc.signal.stop=SIGRTMIN+14
 
 # Uncomment to disable creating tty devices subdirectory in /dev
-# lxc.devttydir =
+# lxc.tty.dir =
 
 # Capabilities
 # Uncomment these if you don't run anything that needs the capability, and
index fdfd790680190fed93d6ee0dd8aee7119c07da36..a0134848902f5ef86ecf3d70daa8b5abfd496bed 100644 (file)
@@ -1,7 +1,7 @@
 # Default configuration shared by all containers
 
 # Setup the LXC devices in /dev/lxc/
-lxc.devttydir = lxc
+lxc.tty.dir = lxc
 
 # Allow for 1024 pseudo terminals
 lxc.pts = 1024
index 07c2bc8b19264cd024df0f5044ad1c13cbd6fa5e..b11f27f62bd6436d8e7bbe1cb53c163efa193141 100644 (file)
@@ -2,7 +2,7 @@
 lxc.include = @LXCTEMPLATECONFIG@/common.conf
 
 # Doesn't support consoles in /dev/lxc/
-lxc.devttydir =
+lxc.tty.dir =
 
 # When using LXC with apparmor, the container will be confined by default.
 # If you wish for it to instead run unconfined, copy the following line
index 49cd411b61785959938e74bcb3fdf788888b0584..477a2abfb80666ff727a3fb52db9be4c3e7f440e 100644 (file)
@@ -7,7 +7,7 @@ lxc.include = @LXCTEMPLATECONFIG@/common.conf
 # Looking for more security, see gentoo.moresecure.conf
 
 # Doesn't support consoles in /dev/lxc/
-lxc.devttydir =
+lxc.tty.dir =
 
 # Extra cgroup device access
 ## rtc
index 878e8390c77dbdde9d69cc16462c1fff106486c5..e9e4e51cccf255728cccec7013c15f6be4158257 100644 (file)
@@ -1,5 +1,5 @@
 # Default console settings
-lxc.devttydir = lxc
+lxc.tty.dir = lxc
 lxc.tty = 4
 lxc.pts = 1024
 
index 718fc5354c228e84cb02dd2faf031658e3cc6e86..7918b4a375fa21140bb06fa6371d0bc5bf624d67 100644 (file)
@@ -2,7 +2,7 @@
 lxc.include = @LXCTEMPLATECONFIG@/common.conf
 
 # Doesn't support consoles in /dev/lxc/
-lxc.devttydir =
+lxc.tty.dir =
 
 # Extra cgroup device access
 ## rtc
index ecb6afead36e49ae63f5515827cc274b145a55c7..21e3148b16d590c93474ad1328d27a49aaaabcad 100644 (file)
@@ -13,7 +13,7 @@ lxc.tty = 1
 lxc.autodev = 1
 
 # Doesn't support consoles in /dev/lxc/
-lxc.devttydir =
+lxc.tty.dir =
 
 # CGroup whitelist
 lxc.cgroup.devices.deny = a
index c932e6db7e350934ad44872164a08b36de41f2cc..899c52ce326c4c4d73397d3b2b9bdb316af69b6c 100644 (file)
@@ -2,7 +2,7 @@
 lxc.include = @LXCTEMPLATECONFIG@/common.conf
 
 # Doesn't support consoles in /dev/lxc/
-lxc.devttydir =
+lxc.tty.dir =
 
 # Extra cgroup device access
 ## rtc
index adb8b7e81fb9cded1b2fd82a0815a135d22cdbfb..b6fe37c97af0ca96ddfd1d0a2a91db791a3f490a 100644 (file)
@@ -1,2 +1,2 @@
 # Ubuntu 10.04 LTS doesn't have /dev/lxc/
-lxc.devttydir =
+lxc.tty.dir =
index 78383ebfc8bcb8e1c62c14a625e291842e9d7f1b..b43d4f3dbba7e87ad209384374ec0dbf29548122 100644 (file)
@@ -3,7 +3,7 @@ lxc.cgroup.devices.deny =
 lxc.cgroup.devices.allow =
 
 # We can't move bind-mounts, so don't use /dev/lxc/
-lxc.devttydir =
+lxc.tty.dir =
 
 # Extra bind-mounts for userns
 lxc.mount.entry = /dev/full dev/full none bind,create=file 0 0
index 41ab1a2fe8e7e23a637f3bd507f5f92a687485aa..9e49fd7b80768a8ee42ed6ee53d7cfa11002a22b 100644 (file)
@@ -12,7 +12,7 @@ lxc.signal.halt=SIGCONT
 
 
 # Uncomment to disable creating tty devices subdirectory in /dev
-# lxc.devttydir =
+# lxc.tty.dir =
 
 # Capabilities
 # Uncomment these if you don't run anything that needs the capability, and
index d9fa41269a9c1a1cbfbe1065d30b813fd4254a93..23446939eac9c1e37532eb0f525b992d47195e20 100644 (file)
@@ -77,7 +77,7 @@ lxc_log_define(lxc_confile, lxc);
 lxc_config_define(personality);
 lxc_config_define(pts);
 lxc_config_define(tty);
-lxc_config_define(ttydir);
+lxc_config_define(tty_dir);
 lxc_config_define(apparmor_profile);
 lxc_config_define(apparmor_allow_incomplete);
 lxc_config_define(selinux_context);
@@ -136,8 +136,14 @@ 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.tty.dir",                   set_config_tty_dir,                     get_config_tty_dir,                     clr_config_tty_dir,                   },
+
+       /* REMOVE IN LXC 3.0
+          legacy devttydir key
+        */
+       { "lxc.devttydir",                 set_config_tty_dir,                     get_config_tty_dir,                     clr_config_tty_dir,                   },
+
        { "lxc.tty",                       set_config_tty,                         get_config_tty,                         clr_config_tty,                       },
-       { "lxc.devttydir",                 set_config_ttydir,                      get_config_ttydir,                      clr_config_ttydir,                    },
        { "lxc.apparmor.profile",          set_config_apparmor_profile,            get_config_apparmor_profile,            clr_config_apparmor_profile,          },
        { "lxc.apparmor.allow_incomplete", set_config_apparmor_allow_incomplete,   get_config_apparmor_allow_incomplete,   clr_config_apparmor_allow_incomplete, },
        { "lxc.selinux.context",           set_config_selinux_context,             get_config_selinux_context,             clr_config_selinux_context,           },
@@ -1295,7 +1301,7 @@ static int set_config_tty(const char *key, const char *value,
        return lxc_safe_uint(value, &lxc_conf->tty);
 }
 
-static int set_config_ttydir(const char *key, const char *value,
+static int set_config_tty_dir(const char *key, const char *value,
                             struct lxc_conf *lxc_conf, void *data)
 {
        return set_config_string_item_max(&lxc_conf->ttydir, value,
@@ -2781,7 +2787,7 @@ static int get_config_tty(const char *key, char *retv, int inlen,
        return lxc_get_conf_int(c, retv, inlen, c->tty);
 }
 
-static int get_config_ttydir(const char *key, char *retv, int inlen,
+static int get_config_tty_dir(const char *key, char *retv, int inlen,
                             struct lxc_conf *c, void *data)
 {
        return lxc_get_conf_str(retv, inlen, c->ttydir);
@@ -3355,7 +3361,7 @@ static inline int clr_config_tty(const char *key, struct lxc_conf *c,
        return 0;
 }
 
-static inline int clr_config_ttydir(const char *key, struct lxc_conf *c,
+static inline int clr_config_tty_dir(const char *key, struct lxc_conf *c,
                                    void *data)
 {
        free(c->ttydir);
index bab9c2ff29cbc41428db36c59159f6b396283017..74334e100db42a92e49be3672be245ed70ed0f64 100644 (file)
@@ -314,13 +314,22 @@ int main(int argc, char *argv[])
                goto non_test_error;
        }
 
-       /* lxc.devttydir */
+       /* REMOVE IN LXC 3.0
+          legacy devttydir keys
+        */
        if (set_get_compare_clear_save_load(c, "lxc.devttydir", "not-dev", tmpf,
                                            true) < 0) {
                lxc_error("%s\n", "lxc.devttydir");
                goto non_test_error;
        }
 
+       /* lxc.tty.dir */
+       if (set_get_compare_clear_save_load(c, "lxc.tty.dir", "not-dev", tmpf,
+                                           true) < 0) {
+               lxc_error("%s\n", "lxc.tty.dir");
+               goto non_test_error;
+       }
+
        /* REMOVE IN LXC 3.0
           legacy security keys
         */
index 200b84e665296fc9340b806235ef66132a1671f2..581ebb37d42248f10de28febc2cf14d7a3358a52 100644 (file)
@@ -122,9 +122,9 @@ ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
 EOF
     # enable getty on active ttys
     local nttys=$(cat "${config_path}/config" ${shared_config} ${common_config} | grep "^lxc.tty" | head -n1 | cut -d= -f2 | tr -d "[:blank:]")
-    local devttydir=$(cat "${config_path}/config" ${shared_config} ${common_config} | grep "^lxc.devttydir" | head -n1 | cut -d= -f2 | tr -d "[:blank:]")
+    local devttydir=$(cat "${config_path}/config" ${shared_config} ${common_config} | grep "^lxc.tty.dir" | head -n1 | cut -d= -f2 | tr -d "[:blank:]")
     local devtty=""
-    # bind getty instances to /dev/<devttydir>/tty* if lxc.devttydir is set
+    # bind getty instances to /dev/<devttydir>/tty* if lxc.tty.dir is set
     [ -n "${devttydir}" ] && devtty="${devttydir}-"
     if [ ${nttys:-0} -gt 1 ]; then
       ( cd "${rootfs_path}/etc/systemd/system/getty.target.wants"
index 1fa5e4826341fb795c01ea1cffb09f42fb3ac350..a211636dc06e92384d3ecde9c5762241647ca024 100644 (file)
@@ -336,7 +336,7 @@ EOF
     # /dev/tty[1-4] will be symlinks to the ptys /dev/lxc/console and
     # /dev/lxc/tty[1-4] so that package updates can overwrite the symlinks.
     # lxc will maintain these links and bind mount ptys over /dev/lxc/*
-    # since lxc.devttydir is specified in the config.
+    # since lxc.tty.dir is specified in the config.
 
     # allow root login on console, tty[1-4], and pts/0 for libvirt
     echo "# LXC (Linux Containers)" >>${rootfs_path}/etc/securetty
index 9731b350523068fe5f381205b27d744f27f800b5..2c5abd13e3c635766f543020a698d374bea2a51b 100644 (file)
@@ -276,7 +276,7 @@ EOF
     # /dev/tty[1-4] will be symlinks to the ptys /dev/lxc/console and
     # /dev/lxc/tty[1-4] so that package updates can overwrite the symlinks.
     # lxc will maintain these links and bind mount ptys over /dev/lxc/*
-    # since lxc.devttydir is specified in the config.
+    # since lxc.tty.dir is specified in the config.
 
     # allow root login on console, tty[1-4], and pts/0 for libvirt
     echo "# LXC (Linux Containers)" >>${rootfs_path}/etc/securetty
index f3d9b2695ea93f848c3934eefa15759c75c252ee..0cd790de94e5d06cc38529edaf60d6cb3c2259e5 100644 (file)
@@ -345,7 +345,7 @@ EOF
     # /dev/tty[1-4] will be symlinks to the ptys /dev/lxc/console and
     # /dev/lxc/tty[1-4] so that package updates can overwrite the symlinks.
     # lxc will maintain these links and bind mount ptys over /dev/lxc/*
-    # since lxc.devttydir is specified in the config.
+    # since lxc.tty.dir is specified in the config.
 
     # allow root login on console, tty[1-4], and pts/0 for libvirt
     cat <<EOF >> "${rootfs}/etc/securetty"
index 35c4215234f123db80f14284d5f87e9afb34ccfc..f06b70ec37324987eabbafbbb017d21e424b7022 100644 (file)
@@ -359,7 +359,7 @@ EOF
     # /dev/tty[1-4] will be symlinks to the ptys /dev/lxc/console and
     # /dev/lxc/tty[1-4] so that package updates can overwrite the symlinks.
     # lxc will maintain these links and bind mount ptys over /dev/lxc/*
-    # since lxc.devttydir is specified in the config.
+    # since lxc.tty.dir is specified in the config.
 
     # allow root login on console, tty[1-4], and pts/0 for libvirt
     echo "# LXC (Linux Containers)" >>$container_rootfs/etc/securetty
index 41769b854508da13c9340c355c444f4ec767bc58..1757706f10dd17e3308b28597b3977f9efa5ab5b 100644 (file)
@@ -229,7 +229,7 @@ EOF
     # /dev/tty[1-4] will be symlinks to the ptys /dev/lxc/console and
     # /dev/lxc/tty[1-4] so that package updates can overwrite the symlinks.
     # lxc will maintain these links and bind mount ptys over /dev/lxc/*
-    # since lxc.devttydir is specified in the config.
+    # since lxc.tty.dir is specified in the config.
 
     # allow root login on console, tty[1-4], and pts/0 for libvirt
     echo "# LXC (Linux Containers)" >>$container_rootfs/etc/securetty