conf: make root idmap structs const

parent 05ea6978
...@@ -1499,7 +1499,7 @@ static int setup_pivot_root(const struct lxc_rootfs *rootfs) ...@@ -1499,7 +1499,7 @@ static int setup_pivot_root(const struct lxc_rootfs *rootfs)
return 0; 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) enum idtype idtype)
{ {
struct lxc_list *it; struct lxc_list *it;
...@@ -3965,7 +3965,8 @@ static int run_userns_fn(void *data) ...@@ -3965,7 +3965,8 @@ static int run_userns_fn(void *data)
static struct id_map *mapped_nsid_add(struct lxc_conf *conf, unsigned id, static struct id_map *mapped_nsid_add(struct lxc_conf *conf, unsigned id,
enum idtype idtype) 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); map = find_mapped_nsid_entry(conf, id, idtype);
if (!map) if (!map)
......
...@@ -233,13 +233,13 @@ struct lxc_conf { ...@@ -233,13 +233,13 @@ struct lxc_conf {
* Pointer to the idmap entry for the container's root uid in * Pointer to the idmap entry for the container's root uid in
* the id_map list. Do not free! * 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 * Pointer to the idmap entry for the container's root gid in
* the id_map list. Do not free! * the id_map list. Do not free!
*/ */
struct id_map *root_nsgid_map; const struct id_map *root_nsgid_map;
}; };
struct lxc_list network; struct lxc_list network;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment