Christian Brauner
339efad99e
conf: non-functional changes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-03 00:41:57 +02:00
Christian Brauner
77803ee7a6
tests: add unit tests for idmap parser
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-03 00:41:56 +02:00
Christian Brauner
0b843d358a
confile_utils: add new file
...
This adds confile_utils.{c,h} which will contain a helpers to parse lxc
configuration files.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-03 00:41:54 +02:00
Shane Chen
59d7470770
add probe status checking
...
Signed-off-by: Shane Chen <ss1ha3tw@gmail.com>
2017-06-02 13:31:55 +08:00
Christian Brauner
c04f651ede
tests: enforce all methods for config items
...
This adds a test that checks LXC's configuration jump table whether all methods
for a given configuration item are implemented. If it is not, we'll error out.
This should provide additional safety since a) the API can now be sure that
dereferencing the pointer for a given method in the config struct is safe and
b) when users implement new configuration keys and forget to implement a
required method we'll see it right away.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-02 02:48:20 +02:00
Christian Brauner
a3c8e60080
confile: add dummy getter for lxc.include
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-02 02:42:19 +02:00
Serge Hallyn
a9849a0685
Merge pull request #1592 from brauner/2017-05-28/idmap_handling
...
idmap improvements
2017-06-01 17:29:55 -05:00
Serge Hallyn
ca3592eb15
Merge pull request #1599 from brauner/2017-05-30/use_minimal_idmap_set
...
conf: use minimal {g,u}id map
2017-06-01 17:12:58 -05:00
Christian Brauner
f8aa4bf308
conf: use minimal {g,u}id map
...
Afaict, userns_exec_1() is only used to operate based on privileges for the
user's own {g,u}id on the host and for the container root's unmapped {g,u}id.
This means we require only to establish a mapping from:
- the container root {g,u}id as seen from the host -> user's host {g,u}id
- the container root -> some sub{g,u}id
The former we add, if the user did not specifiy a mapping. The latter we
retrieve from the ontainer's configured {g,u}id mappings.
Closes #1598 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-01 23:54:47 +02:00
Serge Hallyn
493c623619
Merge pull request #1596 from brauner/2017-05-29/fix_parsing
...
confile: fix parsing
2017-06-01 16:17:11 -05:00
Christian Brauner
1573a51475
Merge pull request #1607 from ss1h2a3tw/master
...
adding warning for mtu ignoring
2017-06-01 20:25:09 +10:00
Shane Chen
72ccbbe1aa
adding warning for mtu ignoring
...
Signed-off-by: Shane Chen <ss1ha3tw@gmail.com>
2017-06-01 14:22:39 +08:00
Christian Brauner
ae4ad10d18
tests: comp retval to exp val whenever we can
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-01 04:10:00 +02:00
Christian Brauner
a182feaebd
confile: performance tweaks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-06-01 04:09:43 +02:00
Christian Brauner
03931c9e18
Merge pull request #1605 from decomposite/systemd_unit_stop
...
Use lxc-stop to stop systemd service
2017-06-01 08:40:40 +10:00
JD Friedrikson
c08d29b6d1
Use lxc-stop to stop systemd service
...
Ever since 8eb62c2
, systemd has not been able to cleanly stop lxc
containers (via lxc@) because it's still using SIGPWR for systemd-based
containers.
We should now use the nice logic in 330ae3d
to stop the containers
instead.
Signed-off-by: JD Friedrikson <yours@decompo.site>
2017-05-31 18:04:37 -04:00
Stéphane Graber
bf3e9c154e
Merge pull request #1601 from brauner/2017-05-30/veth_fixes
...
network: don't delete net devs we didn't create
2017-05-31 13:17:36 -04:00
Christian Brauner
6afd673f2e
lxccontainer: switch api to new clearer callbacks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:59:29 +02:00
Christian Brauner
973082f566
confile: add clearer for lxc.include
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:45:51 +02:00
Christian Brauner
fdf3c5896e
confile: add clearer for lxc.include
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:44:50 +02:00
Christian Brauner
715ccc969c
confile: add clearer for lxc.limit{.*}
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:44:50 +02:00
Christian Brauner
b98c5ab00d
confile: add clearer for lxc.no_new_privs
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:44:50 +02:00
Christian Brauner
59e370db1f
confile: add clearer for lxc.ephemeral
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:44:50 +02:00
Christian Brauner
1044b247c4
confile: add clearer for lxc.init_gid
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:44:49 +02:00
Christian Brauner
ec76dcfb4b
confile: add clearer for lxc.init_uid
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:44:49 +02:00
Christian Brauner
8e90af3ecb
confile: add clearer for lxc.init_cmd
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:44:49 +02:00
Christian Brauner
832fb63a0b
confile: add clearer for lxc.environment
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:44:49 +02:00
Christian Brauner
4850d2237e
confile: add clearer for lxc.group
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:25:23 +02:00
Christian Brauner
adad12caa7
confile: add clearer for lxc.monitor.unshare
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:22:27 +02:00
Christian Brauner
998ca94fb6
confile: add clearer for lxc.syslog
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:21:20 +02:00
Christian Brauner
c61822222d
confile: add clearer for lxc.start.*
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:19:23 +02:00
Christian Brauner
de45f3a838
confile: add clearer for lxc.stopsignal
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:14:50 +02:00
Christian Brauner
cae63cfafc
confile: add clearer for lxc.rebootsignal
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:13:50 +02:00
Christian Brauner
87b288d194
confile: add clearer for lxc.haltsignal
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:12:45 +02:00
Christian Brauner
c721e86c45
confile: add clearer for lxc.autodev
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:11:08 +02:00
Christian Brauner
bbca37d86c
confile: add clearer for lxc.seccomp
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:09:24 +02:00
Christian Brauner
7c2ec23a3d
confile: add clearer for lxc.console.logfile
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:08:13 +02:00
Christian Brauner
4e5b633f10
confile: add clearer for lxc.console
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:06:54 +02:00
Christian Brauner
c74cc4901b
confile: add clearer for lxc.cap.keep
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:05:13 +02:00
Christian Brauner
244cb55bbc
confile: add clearer for lxc.cap.drop
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:03:38 +02:00
Christian Brauner
f44882714c
confile: add clearer for lxc.network
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:02:08 +02:00
Christian Brauner
e2410c4e1b
confile: add clearer for lxc.network.*
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 18:00:40 +02:00
Christian Brauner
c9eeb90c84
confile: add clearer for lxc.hook{.*}
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 17:57:57 +02:00
Christian Brauner
d31d010394
confile: add clearer for lxc.utsname
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 17:55:57 +02:00
Christian Brauner
57928a511e
confile: add dummy clearer for lxc.pivotdir
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 17:54:03 +02:00
Christian Brauner
02becb8d9d
confile: add clearer for lxc.rootfs.backend
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 17:50:59 +02:00
Christian Brauner
7b1eb67de1
confile: add clearer for lxc.rootfs.options
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 17:49:39 +02:00
Christian Brauner
fddefc2df0
confile: add clearer for lxc.rootfs.mount
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 17:48:14 +02:00
Christian Brauner
faca124db4
confile: add clearer for lxc.rootfs
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 17:46:51 +02:00
Christian Brauner
350d4b155d
confile: add clearer for lxc.mount
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-05-31 15:20:55 +02:00