From: Christian Brauner Date: Mon, 28 May 2018 22:52:37 +0000 (+0200) Subject: conf: make root idmap structs const X-Git-Tag: lxc-3.1.0~282^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5173b71073dbb6b3290f969fab5ccd7a304d3c4f;p=thirdparty%2Flxc.git conf: make root idmap structs const Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 76cb255d6..2c6efe71f 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1499,7 +1499,7 @@ static int setup_pivot_root(const struct lxc_rootfs *rootfs) return 0; } -static struct id_map *find_mapped_nsid_entry(struct lxc_conf *conf, unsigned id, +static const struct id_map *find_mapped_nsid_entry(struct lxc_conf *conf, unsigned id, enum idtype idtype) { struct lxc_list *it; @@ -3965,7 +3965,8 @@ static int run_userns_fn(void *data) static struct id_map *mapped_nsid_add(struct lxc_conf *conf, unsigned id, enum idtype idtype) { - struct id_map *map, *retmap; + const struct id_map *map; + struct id_map *retmap; map = find_mapped_nsid_entry(conf, id, idtype); if (!map) diff --git a/src/lxc/conf.h b/src/lxc/conf.h index e8fb4d0ec..e28f54b85 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -233,13 +233,13 @@ struct lxc_conf { * Pointer to the idmap entry for the container's root uid in * the id_map list. Do not free! */ - struct id_map *root_nsuid_map; + const struct id_map *root_nsuid_map; /* * Pointer to the idmap entry for the container's root gid in * the id_map list. Do not free! */ - struct id_map *root_nsgid_map; + const struct id_map *root_nsgid_map; }; struct lxc_list network;