]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/conf.c
userns: clear and save id_map (v2)
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 15 Jul 2013 21:42:15 +0000 (16:42 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 16 Jul 2013 13:10:24 +0000 (08:10 -0500)
commit27c27d73e1b1a07e3621484fa033206549e2a1f5
treeebcd0a5c71e8d8e11e391b89a2a664f3373b267a
parent3ce746862b2a2b33f3de65aeecda0bad1a5dd27c
userns: clear and save id_map (v2)

Otherwise (a) there is a memory leak when using user namespaces and
clearing a config, and (b) saving a container configuration file doesn't
maintain the userns mapping.  For instance, if container c1 has
lxc.id_map configuration entries, then

python3
import lxc
c=lxc.Container("c1")
c.save_config("/tmp/config1")

should show 'lxc.id_map =' entries in /tmp/config1.

Changelog for v2:
   1. fix incorrect saving of group types (s/'c'/'g')
   2. fix typo -> idmap->type should be idmap->idtype

Reported-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
Tested-by: Dwight Engen <dwight.engen@oracle.com>
src/lxc/conf.c
src/lxc/confile.c