Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
42e53c29
Commit
42e53c29
authored
Jun 28, 2017
by
0x0916
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: rename lxc.devttydir to lxc.tty.dir
the legacy keys will be kept around until LXC 3.0 and then will be removed Signed-off-by:
0x0916
<
w@laoqinren.net
>
parent
55c84efc
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
40 additions
and
25 deletions
+40
-25
alpine.common.conf.in
config/templates/alpine.common.conf.in
+1
-1
archlinux.common.conf.in
config/templates/archlinux.common.conf.in
+1
-1
common.conf.in
config/templates/common.conf.in
+1
-1
debian.common.conf.in
config/templates/debian.common.conf.in
+1
-1
gentoo.common.conf.in
config/templates/gentoo.common.conf.in
+1
-1
openwrt.common.conf.in
config/templates/openwrt.common.conf.in
+1
-1
plamo.common.conf.in
config/templates/plamo.common.conf.in
+1
-1
sabayon.common.conf.in
config/templates/sabayon.common.conf.in
+1
-1
slackware.common.conf.in
config/templates/slackware.common.conf.in
+1
-1
ubuntu.lucid.conf.in
config/templates/ubuntu.lucid.conf.in
+1
-1
userns.conf.in
config/templates/userns.conf.in
+1
-1
voidlinux.common.conf.in
config/templates/voidlinux.common.conf.in
+1
-1
confile.c
src/lxc/confile.c
+11
-5
parse_config_file.c
src/tests/parse_config_file.c
+10
-1
lxc-archlinux.in
templates/lxc-archlinux.in
+2
-2
lxc-centos.in
templates/lxc-centos.in
+1
-1
lxc-fedora-legacy.in
templates/lxc-fedora-legacy.in
+1
-1
lxc-fedora.in
templates/lxc-fedora.in
+1
-1
lxc-oracle.in
templates/lxc-oracle.in
+1
-1
lxc-sparclinux.in
templates/lxc-sparclinux.in
+1
-1
No files found.
config/templates/alpine.common.conf.in
View file @
42e53c29
...
...
@@ -2,7 +2,7 @@
lxc.include = @LXCTEMPLATECONFIG@/common.conf
# Doesn't support consoles in /dev/lxc/.
lxc.
devtty
dir =
lxc.
tty.
dir =
# Drop another (potentially) harmful capabilities.
lxc.cap.drop = audit_write
...
...
config/templates/archlinux.common.conf.in
View file @
42e53c29
...
...
@@ -9,7 +9,7 @@ lxc.signal.halt=SIGRTMIN+4
lxc.signal.stop=SIGRTMIN+14
# Uncomment to disable creating tty devices subdirectory in /dev
# lxc.
devtty
dir =
# lxc.
tty.
dir =
# Capabilities
# Uncomment these if you don't run anything that needs the capability, and
...
...
config/templates/common.conf.in
View file @
42e53c29
# Default configuration shared by all containers
# Setup the LXC devices in /dev/lxc/
lxc.
devtty
dir = lxc
lxc.
tty.
dir = lxc
# Allow for 1024 pseudo terminals
lxc.pts = 1024
...
...
config/templates/debian.common.conf.in
View file @
42e53c29
...
...
@@ -2,7 +2,7 @@
lxc.include = @LXCTEMPLATECONFIG@/common.conf
# Doesn't support consoles in /dev/lxc/
lxc.
devtty
dir =
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
...
...
config/templates/gentoo.common.conf.in
View file @
42e53c29
...
...
@@ -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.
devtty
dir =
lxc.
tty.
dir =
# Extra cgroup device access
## rtc
...
...
config/templates/openwrt.common.conf.in
View file @
42e53c29
# Default console settings
lxc.
devtty
dir = lxc
lxc.
tty.
dir = lxc
lxc.tty = 4
lxc.pts = 1024
...
...
config/templates/plamo.common.conf.in
View file @
42e53c29
...
...
@@ -2,7 +2,7 @@
lxc.include = @LXCTEMPLATECONFIG@/common.conf
# Doesn't support consoles in /dev/lxc/
lxc.
devtty
dir =
lxc.
tty.
dir =
# Extra cgroup device access
## rtc
...
...
config/templates/sabayon.common.conf.in
View file @
42e53c29
...
...
@@ -13,7 +13,7 @@ lxc.tty = 1
lxc.autodev = 1
# Doesn't support consoles in /dev/lxc/
lxc.
devtty
dir =
lxc.
tty.
dir =
# CGroup whitelist
lxc.cgroup.devices.deny = a
...
...
config/templates/slackware.common.conf.in
View file @
42e53c29
...
...
@@ -2,7 +2,7 @@
lxc.include = @LXCTEMPLATECONFIG@/common.conf
# Doesn't support consoles in /dev/lxc/
lxc.
devtty
dir =
lxc.
tty.
dir =
# Extra cgroup device access
## rtc
...
...
config/templates/ubuntu.lucid.conf.in
View file @
42e53c29
# Ubuntu 10.04 LTS doesn't have /dev/lxc/
lxc.
devtty
dir =
lxc.
tty.
dir =
config/templates/userns.conf.in
View file @
42e53c29
...
...
@@ -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.
devtty
dir =
lxc.
tty.
dir =
# Extra bind-mounts for userns
lxc.mount.entry = /dev/full dev/full none bind,create=file 0 0
...
...
config/templates/voidlinux.common.conf.in
View file @
42e53c29
...
...
@@ -12,7 +12,7 @@ lxc.signal.halt=SIGCONT
# Uncomment to disable creating tty devices subdirectory in /dev
# lxc.
devtty
dir =
# lxc.
tty.
dir =
# Capabilities
# Uncomment these if you don't run anything that needs the capability, and
...
...
src/lxc/confile.c
View file @
42e53c29
...
...
@@ -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
);
...
...
src/tests/parse_config_file.c
View file @
42e53c29
...
...
@@ -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
*/
...
...
templates/lxc-archlinux.in
View file @
42e53c29
...
...
@@ -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.
devtty
dir"
|
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.
devtty
dir 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"
...
...
templates/lxc-centos.in
View file @
42e53c29
...
...
@@ -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.
devtty
dir 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
...
...
templates/lxc-fedora-legacy.in
View file @
42e53c29
...
...
@@ -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.
devtty
dir 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
...
...
templates/lxc-fedora.in
View file @
42e53c29
...
...
@@ -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.
devtty
dir 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"
...
...
templates/lxc-oracle.in
View file @
42e53c29
...
...
@@ -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.
devtty
dir 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
...
...
templates/lxc-sparclinux.in
View file @
42e53c29
...
...
@@ -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.
devtty
dir 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment