{ LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_MIXED, NULL, "%r/sys/devices/virtual/net", NULL, MS_REMOUNT|MS_BIND|MS_NOSUID|MS_NODEV|MS_NOEXEC, NULL, false },
{ 0, 0, NULL, NULL, NULL, 0, NULL, false }
};
+ struct lxc_rootfs *rootfs = &conf->rootfs;
+ bool has_cap_net_admin;
- bool has_cap_net_admin = lxc_wants_cap(CAP_NET_ADMIN, conf);
+ has_cap_net_admin = lxc_wants_cap(CAP_NET_ADMIN, conf);
for (i = 0; default_mounts[i].match_mask; i++) {
__do_free char *destination = NULL, *source = NULL;
int saved_errno;
if (default_mounts[i].source) {
/* will act like strdup if %r is not present */
- source = lxc_string_replace("%r", conf->rootfs.path ? conf->rootfs.mount : "", default_mounts[i].source);
+ source = lxc_string_replace("%r", rootfs->path ? rootfs->mount : "", default_mounts[i].source);
if (!source)
return -1;
}
}
/* will act like strdup if %r is not present */
- destination = lxc_string_replace("%r", conf->rootfs.path ? conf->rootfs.mount : "", default_mounts[i].destination);
+ destination = lxc_string_replace("%r", rootfs->path ? rootfs->mount : "", default_mounts[i].destination);
if (!destination)
return -1;
default_mounts[i].flags);
r = safe_mount(source, destination, default_mounts[i].fstype,
mflags, default_mounts[i].options,
- conf->rootfs.path ? conf->rootfs.mount : NULL);
+ rootfs->path ? rootfs->mount : NULL);
saved_errno = errno;
if (r < 0 && errno == ENOENT) {
INFO("Mount source or target for \"%s\" on \"%s\" does not exist. Skipping", source, destination);
if (!handler->cgroup_ops->mount(handler->cgroup_ops,
handler,
- conf->rootfs.path ? conf->rootfs.mount : "",
+ rootfs->path ? rootfs->mount : "",
cg_flags))
return log_error_errno(-1, errno, "Failed to mount \"/sys/fs/cgroup\"");
}