]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: make root idmap structs const
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 28 May 2018 22:52:37 +0000 (00:52 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 28 May 2018 22:52:37 +0000 (00:52 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c
src/lxc/conf.h

index 76cb255d6434f8eee9a740540616c43ba8511499..2c6efe71ff81fd1b5094fae9278ba2cc34d04899 100644 (file)
@@ -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)
index e8fb4d0ec180873dd3486ec2d8bd53b67aad5c93..e28f54b85c1fa9bca09125501490e5a6915d8d2c 100644 (file)
@@ -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;